Bottom Sheet
Present compact tasks, an inset iOS sheet, a blurred backdrop, or a scrollable panel with snap points.
npx @swipeui/cli add sheetWhen to use it
- Give a short task or list room at the bottom of the current screen.
- Use an inset system presentation for a compact task on iOS.
- Use snap points and a scrollable body for longer content.
When not to use it
- Use Dialog for a short confirmation.
- Use iOS Native Modal for a task with its own screen.
- Use the Popover hint for short help.
Installation
Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.
npx @swipeui/cli add sheet- Adds
components/swipeui/sheet/sheet.tsx,components/swipeui/sheet/sheet-support.tsand 7 shared helpers. - Installs @expo/ui, @gorhom/bottom-sheet, react-native-gesture-handler, react-native-reanimated, react-native-worklets, react-native-safe-area-context, uniwind, expo-blur, clsx, tailwind-merge, class-variance-authority. In Expo apps it uses
npx expo installso versions match your SDK.
Usage
import { Sheet, SheetScrollView } from '@/components/swipeui/sheet/sheet';
<Sheet
presentation="attached"
title="Saved routes"
open={open}
onOpenChange={setOpen}
snapPoints={['half', 'full']}
>
<SheetScrollView>{routeRows}</SheetScrollView>
</Sheet>;Place SheetProvider inside the app's gesture root and safe-area provider for attached sheets. Keep the screen's state and actions in its component.
| Setting | Default | Behavior |
|---|---|---|
presentation | Platform default | Use attached for an edge panel or detached for the system half sheet in the active theme’s background color. iOS controls the system inset. |
open, defaultOpen, onOpenChange | Closed | Drive or observe visibility. |
snapPoints, initialSnapIndex, onSnapChange | Fit content | Set resting heights from smallest to largest. Use the attached presentation to choose and observe the active index. |
backdrop, backdropStyle | On, dim | Hide the backdrop or choose dim or blur for an attached sheet. |
blurIntensity, blurTarget | 45, no target | Adjust strength. On Android, pass the ref of the background blur target. On devices without blur support, or when Reduce Transparency is on, the backdrop dims. |
dismissible, showHandle | On | Configure available dismissal and the grabber. Keep a visible completion action in a locked sheet. |
returnFocusRef | Unset | Restore focus to the control that launched the sheet. |
title, label | Unset | Provide a heading or accessible name. |
keyboardBehavior, motion | Platform or theme default | Tune the keyboard and motion on attached sheets. |
Use a short body for Basic or Detached. Set scrollable and use SheetScrollView with two or more heights for a long list. See Overlay recipes for filters and sharing.
Keep a fixed header and footer around SheetScrollView when a long picker needs its title, close control and primary action visible at every snap point. Set showHandle={false} when a custom header is the surface's top edge. Use SheetTextInput for an input that participates in the sheet's keyboard handling. Detached sheets preserve the system appearance and can use an optional blur layer behind the presentation.
Behavior and gestures
- Drag a resizable sheet between snap points.
- Swipe down or use the available dismissal action to close.
Accessibility
- The content is marked modal for screen readers and the title is read as a header.
- The escape gesture (two-finger Z on iOS) closes a dismissible sheet.
- Android's back button closes a dismissible sheet with either engine.
- It uses the popover colour tokens in light and dark.
Motion
- Uses the
overlayanddragmotion roles, so it follows your app's feel. Passmotionto tune this one instance. - Attached sheets follow app motion settings. Detached sheets use platform motion.
Performance
- Content mounts only while open; native sheets are drawn by the OS.
Notes for AI
- Set presentation to attached for themed sheets or detached for the inset system presentation.
- Use backdropStyle to choose dim or blur. Supply a blur target on Android.
Compatibility
| Runs on | Supported |
|---|---|
| Expo SDK 57 | Yes |
| Expo SDK 58 | Yes |
| React Native CLI (with Expo modules) | Yes |
| Expo Go | Yes |
| iOS | Yes |
| Android | Yes |
This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.