npx gluestack-ui@alpha add bottomsheetimport {
BottomSheet,
BottomSheetBackdrop,
BottomSheetContent,
BottomSheetDragIndicator,
BottomSheetFlatList,
BottomSheetFooter,
BottomSheetItem,
BottomSheetItemText,
BottomSheetPortal,
BottomSheetScrollView,
BottomSheetSectionList,
BottomSheetTextInput,
BottomSheetTrigger,
} from '@/components/ui/bottomsheet';
export default () => (
<BottomSheet>
<BottomSheetTrigger>
<Text>Open BottomSheet</Text>
</BottomSheetTrigger>
<BottomSheetPortal
snapPoints={['25%', '50%']}
backdropComponent={BottomSheetBackdrop}
handleComponent={BottomSheetDragIndicator}
>
<BottomSheetContent>
<BottomSheetItem>
<BottomSheetItemText>Item 1</BottomSheetItemText>
</BottomSheetItem>
<BottomSheetItem>
<BottomSheetItemText>Item 2</BottomSheetItemText>
</BottomSheetItem>
<BottomSheetItem>
<BottomSheetItemText>Item 3</BottomSheetItemText>
</BottomSheetItem>
</BottomSheetContent>
</BottomSheetPortal>
</BottomSheet>
);
| Prop | Type | Default | Description |
|---|---|---|---|
defaultSnapIndex | number | 0 | The index of snapPoints at which the bottom sheet initially opens when triggered. |
onOpen | () => void | - | Callback fired when the bottom sheet opens. |
onClose | () => void | - | Callback fired when the bottom sheet closes. |
onChange | (index: number) => void | - | Callback fired whenever the sheet snaps to a new index. Receives the current snap index (-1 when closed). |
| Method | Signature | Description |
|---|---|---|
open | (index?: number) => void | Opens the bottom sheet. Optionally pass a snap index; defaults to defaultSnapIndex. |
close | () => void | Closes the bottom sheet. |
snapToIndex | (index: number) => void | Snaps the sheet to the given snap point index. |
expand | () => void | Expands the sheet to the highest snap point. |
collapse | () => void | Collapses the sheet to the lowest snap point. |
| Prop | Type | Default | Description |
|---|---|---|---|
index | number | - | Snap index to open the sheet at. Overrides defaultSnapIndex when provided. |
| Prop | Type | Default | Description |
|---|---|---|---|
snapPoints | Array<string | number> | - | Required. Points for the bottom sheet to snap to. Accepts numbers or percentage strings (e.g. '50%'). |
enablePanDownToClose | boolean | true | Enables closing the sheet by panning downward. |
enableDynamicSizing | boolean | false | Enables the sheet height to be determined dynamically by its content. |
closeOnBackdropPress | boolean | true | Closes the sheet when the backdrop is pressed. |
backgroundClassName | string | - | NativeWind className applied to the sheet background surface. |
handleIndicatorClassName | string | - | NativeWind className applied to the drag handle indicator. |
| Prop | Type | Default | Description |
|---|---|---|---|
disappearsOnIndex | number | -1 | Snap index at which the backdrop disappears. |
appearsOnIndex | number | 0 | Snap index at which the backdrop appears. |
opacity | number | 0.5 | Opacity of the backdrop overlay. |
pressBehavior | 'close' | 'collapse' | 'none' | 'close' | Defines what happens when the backdrop is pressed. |
| Prop | Type | Default | Description |
|---|---|---|---|
focusScope | boolean | true | When true, wraps content in a FocusScope on web for keyboard accessibility (traps focus and restores it on close). |
| Prop | Type | Default | Description |
|---|---|---|---|
closeOnSelect | boolean | true | Automatically closes the sheet when the item is pressed. |