Bottom sheet
A sheet that rests at a peek or full height and follows your finger.
npx shadcn@latest add @silicon-ui/bottom-sheetInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/bottom-sheetManually
Install the dependencies
npm install @radix-ui/react-dialog lucide-react motionCopy these files into your project
- components/silicon-ui/bottom-sheet/bottom-sheet.tsx
- components/silicon-ui/bottom-sheet/bottom-sheet.module.css
Shared with other components. Skip any you already have.
- components/silicon-ui/lib/escape.ts
- components/silicon-ui/lib/return-focus.ts
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
BottomSheet
| Prop | Type | Default |
|---|---|---|
title* | string | — |
children* | ReactNode | — |
triggerThe control that opens the sheet, usually a button. Focus returns to it when the sheet closes. | ReactNode | — |
open | boolean | — |
defaultOpen | boolean | false |
onOpenChange | (open: boolean) => void | — |
description | string | — |
detentsResting heights as fractions of the viewport height. The sheet opens at `initialDetent` and never grows past the largest. | number[] | — |
initialDetentIndex into the sorted detents the sheet opens at. Defaults to the smallest. | number | — |
onDetentChange | (index: number) => void | — |
closeLabel | string | — |
className | string | — |
BottomSheetClose
Accepts the props of ButtonHTMLAttributes.