This is the complete react-native-reanimated-modal documentation, as Markdown. # react-native-reanimated-modal > A lightweight, performant modal for React Native — fade, slide, scale or your own animations on the UI thread, swipe to dismiss in any direction, on top of the native Modal. A lightweight, performant modal for React Native — animations on the UI thread, swipe to dismiss in any direction, on top of the native Modal. - [Get started](/react-native-reanimated-modal/getting-started/) - [Example app](/react-native-reanimated-modal/example/) - [GitHub](https://github.com/whidrubeld/react-native-reanimated-modal) ![The example app: modals fading, sliding and scaling in, dismissed with a swipe, over a dimmed and a blurred backdrop](/react-native-reanimated-modal/images/example.gif) Fig. 01The example app A modal built on React Native’s own [`Modal`](https://reactnative.dev/docs/modal) — so it behaves like one on every platform — with its animations and gestures in [Reanimated](https://docs.swmansion.com/react-native-reanimated/) and [Gesture Handler](https://docs.swmansion.com/react-native-gesture-handler/): they run on the UI thread, and stay smooth while JavaScript is busy. ```bash npm install react-native-reanimated-modal ``` ## Features * **[Animations](/react-native-reanimated-modal/animations/)** `fade`, `slide` from any edge and `scale`, each with its duration — as a string, or a typed config. * **[Your own animations](/react-native-reanimated-modal/custom-animations/)** Worklets for the content and the backdrop get the progress, the swipe offset and the state, and return a style: on top of a preset, or as `custom` on their own. * **[Swipe to dismiss](/react-native-reanimated-modal/swipe/)** In one direction or all four, with a distance to reach, and a spring back when it is not reached; the backdrop fades as the content goes. * **[Backdrop](/react-native-reanimated-modal/backdrop/)** A color and an opacity, your own component (a blur), or none; a press closes the modal, or calls your handler, or does nothing. * **[Declarative or imperative](/react-native-reanimated-modal/ref/)** `visible` and `onHide` like any modal, or `ref.current.open()` / `close()` when the modal is mounted visible. * **[Several at once](/react-native-reanimated-modal/multiple-modals/)** `coverScreen` draws the modal in your tree instead of a native window: modals stack, and sit in a `FullWindowOverlay` above React Navigation’s screens. * **[Native behaviour](/react-native-reanimated-modal/platforms/)** The Android back button (or your handler for it), translucent status and navigation bars, iOS orientations — the native `Modal`’s props, passed through. * **[Testable](/react-native-reanimated-modal/testing/)** Test IDs for the container, the backdrop and the content; works with Jest and React Native Testing Library. * **Small** One component in TypeScript, no dependencies of its own: Reanimated, Worklets and Gesture Handler are peers. ## For AI assistants Every page is also Markdown: add `.md` to its URL, or use **Copy page** above its title. [`llms.txt`](/react-native-reanimated-modal/llms.txt) lists them, [`llms-full.txt`](/react-native-reanimated-modal/llms-full.txt) is all of them in one file — [LLMs](/react-native-reanimated-modal/llms/). # Getting started > Install react-native-reanimated-modal and its peers, check the version for your Expo SDK or Worklets, and show a first modal. ## Install ```bash npm install react-native-reanimated-modal # or: yarn add react-native-reanimated-modal · pnpm add react-native-reanimated-modal · bun add react-native-reanimated-modal ``` The library has no dependencies of its own. It needs these peers, each installed by its own guide — they have native code and a Babel plugin to set up: | Package | Why | | ------------------------------------------------------------------------------------------------------------------------ | --------------------------------------- | | [`react-native-reanimated`](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/) | The animations, on the UI thread | | [`react-native-worklets`](https://docs.swmansion.com/react-native-worklets/docs/) | Reanimated 4’s worklets, and its plugin | | [`react-native-gesture-handler`](https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/installation) | Swipe to dismiss | With Expo, `npx expo install react-native-reanimated react-native-worklets react-native-gesture-handler` picks the versions of your SDK, and `babel-preset-expo` adds the Worklets plugin by itself. Without Expo, add `react-native-worklets/plugin` to your `babel.config.js`. ## Version compatibility Version **1.2.5** moved to the Worklets API of `react-native-worklets` 0.7.2 and later; it does not run with older Worklets. | `react-native-reanimated-modal` | `react-native-worklets` | Expo SDK | | ------------------------------- | ----------------------- | -------- | | 1.2.5 and later | 0.7.2 and later | 55+ | | 1.2.4 | 0.5.1 | 54 | On Expo SDK 54 or below, or with `react-native-worklets@0.5.1`, install 1.2.4: ```bash npm install react-native-reanimated-modal@1.2.4 ``` Mismatched versions fail at runtime or leave the modal without its animations. The current release is developed and tested against the [example app](/react-native-reanimated-modal/example/)’s versions: Expo SDK 58, React Native 0.88, Reanimated 4.7, Worklets 0.13 and Gesture Handler 3.3. ## A first modal Wrap your app in `GestureHandlerRootView` once — the modal’s swipe needs it on iOS (on Android the modal brings its own): ```tsx import { useState } from 'react'; import { Button, Text, View } from 'react-native'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { Modal } from 'react-native-reanimated-modal'; export default function App() { const [visible, setVisible] = useState(false); return (