Elements

Reference

Drawer

Drawer, dressed in the paper-and-ink system: a full-height sheet cut flush to the edge it rises from, sliding on the machine's translate under the grabber's hand. The parts — Root, Trigger, Backdrop, Positioner, Content, Grabber, GrabberIndicator, Title, Description, CloseTrigger, SwipeArea.

Positioner · Content · Title · Description · Trigger · Backdrop · Grabber · GrabberIndicator · CloseTrigger · SwipeArea

#Backdrop

A styled part — no props of its own; it takes the anatomy's shared styling.

#CloseTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#Content

A styled part — no props of its own; it takes the anatomy's shared styling.

#Description

A styled part — no props of its own; it takes the anatomy's shared styling.

#GrabberIndicator

A styled part — no props of its own; it takes the anatomy's shared styling.

#Grabber

A styled part — no props of its own; it takes the anatomy's shared styling.

#IndentBackground

A styled part — no props of its own; it takes the anatomy's shared styling.

#Indent

A styled part — no props of its own; it takes the anatomy's shared styling.

#Positioner

A styled part — no props of its own; it takes the anatomy's shared styling.

#Root

PropTypeDefaultDescription
closeOnEscapebooleantrueWhether to close the drawer when the escape key is pressed.
closeOnInteractOutsidebooleantrueWhether to close the drawer when the outside is clicked.
closeThresholdnumber0.25The threshold distance for dismissing the drawer.
defaultOpenbooleanThe initial open state of the drawer.
defaultSnapPointdrawer.SnapPoint | null1The default snap point of the drawer.
defaultTriggerValuestring | nullThe initial trigger value when rendered. Use when you don't need to control the trigger value.
finalFocusEl() => HTMLElement | nullElement to receive focus when the sheet is closed.
idstringThe unique identifier of the machine.
idsPartial<{ backdrop: string; positioner: string; content: string; title: string; trigger: string; grabber: string; grabberIndicator: string; closeTrigger: string; }>The ids of the elements in the drawer. Useful for composition.
initialFocusEl() => HTMLElement | nullElement to receive focus when the sheet is opened.
modalbooleantrueWhether to prevent pointer interaction outside the element and hide all content below it.
openbooleanWhether the drawer is open.
preventDragOnScrollbooleantrueWhether to prevent dragging on scrollable elements.
preventScrollbooleantrueWhether to prevent scrolling behind the sheet when it's opened
restoreFocusbooleanWhether to restore focus to the element that had focus before the sheet was opened.
role'dialog' | 'alertdialog'"dialog"The sheet's role
snapPointdrawer.SnapPoint | nullThe currently active snap point.
snapPoints(number | string)[][1]The snap points of the drawer.
snapToSequentialPointsbooleanfalseWhether the drawer should snap to sequential points when swiping.
swipeDirectiondrawer.SwipeDirection"down"The direction in which the drawer can be swiped.
swipeVelocityThresholdnumber700The threshold velocity (in pixels/s) for closing the drawer.
trapFocusbooleantrueWhether to trap focus inside the sheet when it's opened.
triggerValuestring | nullThe value of the trigger that currently open the drawer
EventPayload
exitComplete—
openChangedetails: OpenChangeDetails
update:openopen: boolean
snapPointChangedetails: SnapPointChangeDetails
update:snapPointsnapPoint: SnapPoint | null
triggerValueChangedetails: TriggerValueChangeDetails
update:triggerValuetriggerValue: string | null

#Stack

A styled part — no props of its own; it takes the anatomy's shared styling.

#SwipeArea

A styled part — no props of its own; it takes the anatomy's shared styling.

#Title

A styled part — no props of its own; it takes the anatomy's shared styling.

#Trigger

A styled part — no props of its own; it takes the anatomy's shared styling.