structyl

The full prop reference for the Sheet component. A panel that slides in from any edge of the screen.

Import

tsx
import { Sheet } from '@structyl/styled';

Props

Sheet.Root

Container and state manager for the entire sheet component

PropTypeDefault
open#boolean

Controlled open state of the sheet

defaultOpen#boolean

Initial open state when uncontrolled

false
onOpenChange#(open: boolean) => void

Callback fired when open state changes

modal#boolean

Whether the sheet behaves as a modal (traps focus, blocks interaction outside)

true
children#React.ReactNode

Content to render inside the root context

Sheet.Trigger

Button that opens the sheet when clicked

PropTypeDefault
asChild#boolean

Pass child as the trigger element instead of wrapping in a button

className#string

Additional CSS classes

onClick#(event: React.MouseEvent<HTMLButtonElement>) => void

Click event handler

Sheet.Portal

Renders sheet content in a portal container

PropTypeDefault
children#React.ReactNode

Content to render in the portal

container#Element | DocumentFragment | null

DOM element to portal content into (defaults to document.body)

forceMount#boolean

Force the portal content to mount even when sheet is closed

Sheet.Overlay

Semi-transparent backdrop behind the sheet content

PropTypeDefault
asChild#boolean

Pass child as the overlay element instead of wrapping in a div

forceMount#boolean

Force the overlay to mount even when sheet is closed

className#string

Additional CSS classes

Sheet.Content

Main container for sheet content that slides in from the specified side

PropTypeDefault
side#'top' | 'bottom' | 'left' | 'right'

Side of the screen the sheet slides in from

'right'
asChild#boolean

Pass child as the content element instead of wrapping in a div

forceMount#boolean

Force the content to mount even when sheet is closed

onEscapeKeyDown#(event: KeyboardEvent) => void

Callback when Escape key is pressed while content is focused

onPointerDownOutside#(event: PointerDownOutsideEvent) => void

Callback when pointer down occurs outside the sheet

onInteractOutside#(event: PointerDownOutsideEvent | FocusOutsideEvent) => void

Callback when any interaction occurs outside the sheet

onOpenAutoFocus#(event: Event) => void

Callback to control initial focus when sheet opens

onCloseAutoFocus#(event: Event) => void

Callback to control focus restoration when sheet closes

className#string

Additional CSS classes

children#React.ReactNode

Content to render inside the sheet

Sheet.Header

Helper component for sheet header layout with default spacing and text alignment

PropTypeDefault
className#string

Additional CSS classes

children#React.ReactNode

Content to render inside the header

Sheet.Title

Semantic heading for the sheet with default text styling

PropTypeDefault
asChild#boolean

Pass child as the title element instead of wrapping in an h2

className#string

Additional CSS classes

children#React.ReactNode

Content to render as the title

Sheet.Description

Semantic description text for the sheet with default text styling

PropTypeDefault
asChild#boolean

Pass child as the description element instead of wrapping in a p

className#string

Additional CSS classes

children#React.ReactNode

Content to render as the description

Sheet.Close

Button that closes the sheet when clicked

PropTypeDefault
asChild#boolean

Pass child as the close element instead of wrapping in a button

className#string

Additional CSS classes

onClick#(event: React.MouseEvent<HTMLButtonElement>) => void

Click event handler

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library