Sheet API
View componentThe full prop reference for the Sheet component. A panel that slides in from any edge of the screen.
Import
import { Sheet } from '@structyl/styled';Props
Sheet.Root
Container and state manager for the entire sheet component
| Prop | Type | Default |
|---|---|---|
| open# | booleanControlled open state of the sheet | — |
| defaultOpen# | booleanInitial open state when uncontrolled | false |
| onOpenChange# | (open: boolean) => voidCallback fired when open state changes | — |
| modal# | booleanWhether the sheet behaves as a modal (traps focus, blocks interaction outside) | true |
| children# | React.ReactNodeContent to render inside the root context | — |
Sheet.Trigger
Button that opens the sheet when clicked
| Prop | Type | Default |
|---|---|---|
| asChild# | booleanPass child as the trigger element instead of wrapping in a button | — |
| className# | stringAdditional CSS classes | — |
| onClick# | (event: React.MouseEvent<HTMLButtonElement>) => voidClick event handler | — |
Sheet.Portal
Renders sheet content in a portal container
| Prop | Type | Default |
|---|---|---|
| children# | React.ReactNodeContent to render in the portal | — |
| container# | Element | DocumentFragment | nullDOM element to portal content into (defaults to document.body) | — |
| forceMount# | booleanForce the portal content to mount even when sheet is closed | — |
Sheet.Overlay
Semi-transparent backdrop behind the sheet content
| Prop | Type | Default |
|---|---|---|
| asChild# | booleanPass child as the overlay element instead of wrapping in a div | — |
| forceMount# | booleanForce the overlay to mount even when sheet is closed | — |
| className# | stringAdditional CSS classes | — |
Sheet.Content
Main container for sheet content that slides in from the specified side
| Prop | Type | Default |
|---|---|---|
| side# | 'top' | 'bottom' | 'left' | 'right'Side of the screen the sheet slides in from | 'right' |
| asChild# | booleanPass child as the content element instead of wrapping in a div | — |
| forceMount# | booleanForce the content to mount even when sheet is closed | — |
| onEscapeKeyDown# | (event: KeyboardEvent) => voidCallback when Escape key is pressed while content is focused | — |
| onPointerDownOutside# | (event: PointerDownOutsideEvent) => voidCallback when pointer down occurs outside the sheet | — |
| onInteractOutside# | (event: PointerDownOutsideEvent | FocusOutsideEvent) => voidCallback when any interaction occurs outside the sheet | — |
| onOpenAutoFocus# | (event: Event) => voidCallback to control initial focus when sheet opens | — |
| onCloseAutoFocus# | (event: Event) => voidCallback to control focus restoration when sheet closes | — |
| className# | stringAdditional CSS classes | — |
| children# | React.ReactNodeContent to render inside the sheet | — |
Sheet.Header
Helper component for sheet header layout with default spacing and text alignment
| Prop | Type | Default |
|---|---|---|
| className# | stringAdditional CSS classes | — |
| children# | React.ReactNodeContent to render inside the header | — |
Sheet.Title
Semantic heading for the sheet with default text styling
| Prop | Type | Default |
|---|---|---|
| asChild# | booleanPass child as the title element instead of wrapping in an h2 | — |
| className# | stringAdditional CSS classes | — |
| children# | React.ReactNodeContent to render as the title | — |
Sheet.Description
Semantic description text for the sheet with default text styling
| Prop | Type | Default |
|---|---|---|
| asChild# | booleanPass child as the description element instead of wrapping in a p | — |
| className# | stringAdditional CSS classes | — |
| children# | React.ReactNodeContent to render as the description | — |
Sheet.Close
Button that closes the sheet when clicked
| Prop | Type | Default |
|---|---|---|
| asChild# | booleanPass child as the close element instead of wrapping in a button | — |
| className# | stringAdditional CSS classes | — |
| onClick# | (event: React.MouseEvent<HTMLButtonElement>) => voidClick event handler | — |
Source code
If you didn't find what you need here, read the component implementation .