Sheet
Present a focused drawer from a viewport edge.
Anatomy#
Content is portaled and renders inside the overlay element. With overlay={false}, that element is an unstyled wrapper without the overlay slot.
Usage#
Use Sheet for a focused drawer from a viewport edge, such as mobile navigation or an inspector. Use Drawer when the surface needs swipe-to-dismiss gestures or snap points. Use Dialog for a centered labeled task. Use BaseDialog to compose backdrop and content yourself. Use Popover for anchored content that should not take over the page. Use DropdownMenu for a compact action list.
Sheet shares modal dismissal and focus behavior with Dialog.
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, set aria-label or aria-labelledby on Content.
Sheet.Close is an explicit close control you can place inside the root; it is separate from
Content’s automatic corner close button. Set root closable={false} to hide the corner button, or
closeIcon to replace its icon. Its accessible label comes from the close message; override it
with root translations. See Localization. Root transition={false} turns
off the enter and exit animations, so content and overlay unmount as soon as the sheet closes.
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.
Use initialFocus to choose the element that receives focus on open, or false to skip the move,
and finalFocus to choose where focus returns. Both apply only while modal is true.
Setting modal={false} allows focus to leave the surface, but does not disable Escape or outside
dismissal. closeOnOverlayClick and closeOnEscape control those close requests. Both default to
true. 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 every part: trigger, overlay, content, header, title, description,
contentClose, body, and footer. See
Customization for precedence.
Set root mount 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 (top, right, bottom, or left; default right), and set inset when the sheet 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; onClosePrevented receives blocked outside or Escape
attempts.
Keyboard interaction#
| Key | Description |
|---|---|
| Esc | Requests dismissal when closeOnEscape is not false. |
| ⇥ | Moves focus forward; modal sheets contain focus. |
| Shift + Tab | Moves focus backward; modal sheets contain focus. |
Examples#
Edit settings#
Place fields in the body and Cancel/Done in the footer. The default side is right.
Open a sheet from layout state#
A page button owns open. Closing from the footer reports back through onOpenChange.
Keep a sheet open until an explicit close#
closeOnOverlayClick={false} and closeOnEscape={false} block overlay click and Escape, and
onClosePrevented reports each blocked attempt. The footer action is the only way to close.
Open navigation, a cart, or share from different edges#
Left holds navigation, right a cart with checkout, and bottom share actions.
API Reference#
Attributes#
data-closeddata-disableddata-expandeddata-overlay-scrolldata-transitiondata-headerProps#
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.
Body#
Renders a <div> element by default.
Footer#
Renders a <div> element by default.
Close#
Renders a <button> element by default.