Example app
The repository’s example/ is an Expo app with a modal for every use case below.
On your phone
Section titled “On your phone”- Install Expo Go.
- Scan the QR code with the camera (iOS) or from Expo Go (Android).
- The example opens in Expo Go.
From the repository
Section titled “From the repository”pnpm installpnpm example start # Metro; then press i, a or wpnpm example ios # or: android, webThe app uses the library’s source (src/) through Metro: changes show up without a build. More in CONTRIBUTING.md.
Use cases
Section titled “Use cases”| Modal | Shows | Source |
|---|---|---|
| Basic | The defaults: fade, backdrop, swipe down | Basic.tsx |
| Multiple | Two coverScreen modals stacked, sliding from different edges, swiped in any direction |
Multiple.tsx |
| Input | A text field over the keyboard (react-native-keyboard-controller) |
Input.tsx |
| Scroll | A scrolling list in a scale modal swiped down |
Scroll.tsx |
| Blur | An expo-blur backdrop |
Blur.tsx |
| Fullscreen | contentContainerStyle={{ flex: 1 }}, sliding |
Fullscreen.tsx |
| Alert | A toast without backdrop over a usable screen, dismissed by a swipe or a timer | Alert.tsx |
| Bottom half | A bottom sheet: justifyContent: 'flex-end', a slide, a longer swipe threshold |
BottomHalf.tsx |