Components
Bottom Sheet A gesture-driven modal sheet that slides up from the bottom with a drag handle.
A gesture-driven modal that slides up from the bottom of the screen. Supports drag-to-dismiss via a pan gesture, backdrop press to close, and spring-based animations.
npx @tapcn/cli add bottom-sheet
Or using shadcn directly:
npx shadcn@latest add https://tapcn.vercel.app/r/bottom-sheet.json
import { useState } from 'react' ;
import {
BottomSheet,
BottomSheetContent,
BottomSheetHandle,
BottomSheetHeader,
BottomSheetTitle,
BottomSheetFooter,
} from '~/components/ui/bottom-sheet' ;
import { Button } from '~/components/ui/button' ;
import { Text } from '~/components/ui/text' ;
export function Example () {
const [ open , setOpen ] = useState ( false );
return (
< BottomSheet open ={ open } onOpenChange ={ setOpen } >
< Button onPress ={ () => setOpen ( true ) } >
< Text >Open Sheet</ Text >
</ Button >
< BottomSheetContent >
< BottomSheetHandle />
< BottomSheetHeader >
< BottomSheetTitle >Sheet Title</ BottomSheetTitle >
</ BottomSheetHeader >
< BottomSheetFooter >
< Button onPress ={ () => setOpen ( false ) } >
< Text >Close</ Text >
</ Button >
</ BottomSheetFooter >
</ BottomSheetContent >
</ BottomSheet >
);
}
Component Description BottomSheetRoot provider component. Controls open state. BottomSheetContentThe sheet panel with backdrop overlay and drag-to-dismiss. BottomSheetHandleA small drag handle bar rendered at the top of the sheet. BottomSheetHeaderGroups title content with centered text and padding. BottomSheetTitleThe heading text for the sheet. BottomSheetFooterAction buttons area at the bottom of the sheet.
Prop Type Default Description openboolean-- Whether the sheet is open. onOpenChange(open: boolean) => void-- Callback when the open state changes. childrenReactNode-- Child components.
Prop Type Default Description classNamestring-- Additional NativeWind classes for the sheet container. childrenReactNode-- Content rendered inside the sheet.
Prop Type Default Description classNamestring-- Additional NativeWind classes.
Prop Type Default Description classNamestring-- Additional NativeWind classes. childrenReactNode-- Header content (typically a BottomSheetTitle).
Extends React Native's Text props.
Prop Type Default Description classNamestring-- Additional NativeWind classes.
Prop Type Default Description classNamestring-- Additional NativeWind classes. childrenReactNode-- Footer content (typically action buttons).
Web : Adds shadow-lg styling to the sheet container.
Native : Uses React Native's PanResponder for drag-to-dismiss gesture. Dismisses when dragged down more than 100px.
Both platforms use react-native-reanimated for enter/exit animations (SlideInDown/SlideOutDown with spring physics, FadeIn/FadeOut for the backdrop).
text -- for TextClassContext
react-native-reanimated -- spring-based enter/exit animations