Sheet
Present a focused drawer from a viewport edge.
Use Sheet for a focused drawer from a viewport edge, such as mobile navigation or an inspector. It shares modal dismissal and focus behavior with its overlay family.
Basic usage#
Playground#
Anatomy#
Content is portaled. Overlay and Content are siblings by default; scrollable overlay mode nests Content inside Overlay.
Usage#
Content composition#
Use Content title and description for simple cases:
For a custom header layout, compose the anatomy parts:
An explicit Sheet.Header replaces the header generated by Content’s title and description.
Sheet.Title and Sheet.Description connect their IDs to the surface’s accessible name and description.
Without a visible title, supply root ariaLabel or native ARIA labeling on Content.
Sheet.Action places actions beside the title. Sheet.Close is an explicit close control you can
place inside the root; it is separate from Content’s automatic corner close button.
Use root close={false} to hide the automatic close button, or closeIcon to replace its icon.
Focus and outside interaction#
modal defaults to true: focus stays inside the surface, outside content is hidden from assistive
technology, and native outside pointer actions are prevented. Closing restores focus to the trigger.
Setting modal={false} allows focus to leave the surface, but does not disable Escape or outside
dismissal. dismissible controls those close requests. Scroll locking is independent:
preventScroll defaults to true. For interaction with the background page, also set
preventScroll={false} and overlay={false}.
Styling and portal placement#
Apply class and object style directly to each rendered part. Root classes and styles set
slot defaults for the family; Content’s slot maps cover only overlay, content, and contentClose.
See Customization for precedence.
Set root portalMount to place Content in a chosen container. This also works for controlled
surfaces without a Trigger.
Structured drawer#
Choose the viewport edge with root side, and use inset when the drawer needs space around it.
Compose body and footer regions to keep the task content separate from its actions.
State and dismissal#
Use controlled open state when a layout owns visibility. Disable normal dismissal only when the sheet has a clear explicit close action; onClosePrevent receives blocked outside or Escape attempts.
Keyboard interaction#
| Key | Description |
|---|---|
| Esc | Requests dismissal when dismissible={true}. |
| ⇥ | Moves focus forward; modal sheets contain focus. |
| Shift + Tab | Moves focus backward; modal sheets contain focus. |
Examples#
Dismiss control#
Sides#
Attributes#
data-closedSlot: sheet-trigger, sheet-content, sheet-overlayDescription: Present when disclosure or transition content is closed.data-disabledSlot: sheet-triggerDescription: Present when the component, slot, or item is disabled.data-expandedSlot: sheet-trigger, sheet-content, sheet-overlayDescription: Present when the panel, accordion, or menu is expanded.data-overlay-scrollSlot: sheet-overlayDescription: Present when scrolling is owned by the overlay.data-transitionSlot: sheet-contentDescription: Present while a target participates in a visibility transition.data-headerSlot: sheet-bodyDescription: Present when the component renders header content.Props#
Sheet#
Trigger#
Renders a <button> element by default.
Content#
Props for Sheet.Content. Renders a <div> element by default.
Header#
Renders a <div> element by default.
Title#
Renders a <h2> element by default.
Description#
Renders a <p> element by default.
Action#
Renders a <div> element by default.
Body#
Renders a <div> element by default.
Footer#
Renders a <div> element by default.
Close#
Renders a <button> element by default.