Motion UIComponentsComponent

Sheet

Motion's bottom-sheet choreography on the native HTML dialog element, with a 50px fade-up entrance plus drag and flick dismissal. Keep SheetBackdrop and SheetPanel as direct Sheet children.

npx shadcn@latest add @motion/sheet

API reference

Components

<Sheet />

Root coordinating native <dialog> state, drag position and element refs.

children?

ReactNode

Trigger, backdrop, panel and resting content.

open?

boolean

Controlled open state.

defaultOpen?

boolean = false

Initial open state when uncontrolled. Default false.

onOpenChange?

(open: boolean) => void

Called on open-state changes.

<SheetTrigger />

Button that opens the sheet.

children?

ReactNode

Trigger contents.

className?

string

Merged onto the trigger button.

<SheetBackdrop />

Dimming scrim whose opacity follows the sheet drag position.

className?

string

Scrim surface class. Defaults to bg-black.

label?

string

Accessible label; when set the scrim is a dismiss button.

<SheetPanel />

Draggable spring panel with fade-up entrance.

children?

ReactNode

Sheet contents.

dismissOffset?

number = 92

Downward drag distance (px) to dismiss. Default 92.

dismissVelocity?

number = 840

Downward flick velocity (px/s) to dismiss. Default 840.

labelledBy?

string

id of the labelling element, wired to aria-labelledby.

className?

string

Merged onto the panel.

<SheetHandle />

Decorative grab affordance at the top of the sheet.

className?

string

Merged onto the centring row.

<SheetClose />

Close button for the top-right of the sheet.

children?

ReactNode

Button contents. Defaults to a close glyph.

label?

string = "Close"

Accessible label. Default "Close".

className?

string

Merged onto the button.

Hooks

useSheet

Read or control the enclosing sheet's open state.

useSheet(): UseSheet

Returns

open

boolean

Whether the sheet is open.

setOpen

(open: boolean) => void

Open or close the sheet.

Functions

shouldDismissSheet

Whether a drag release should dismiss the sheet.

shouldDismissSheet(offsetY: number, velocityY: number, dismissOffset: number, dismissVelocity: number): boolean