Centered dialog
A centered dialog with zoom and fade. Its CSS class sets the width; dragging is disabled.
<Sheet.Root side="center"> <Sheet.Trigger>Delete project</Sheet.Trigger> <Sheet.Content className="sheet" style={{ width: 400 }}> <Sheet.Title>Delete this project?</Sheet.Title> <Sheet.Description>This can't be undone.</Sheet.Description> <Sheet.Close>Cancel</Sheet.Close> </Sheet.Content></Sheet.Root>side="center" places a content-sized panel in the middle of the viewport. It has no travel,
detents, or drag. It opens and closes with a spring-driven zoom (scale 0.95 to 1) and fade.
Width is yours
Section titled “Width is yours”The panel has no fixed width. Its default max-inline-size is min(560px, 100%). Set the
width in your own CSS:
.sheet { width: 400px;}For a wider dialog, raise the maximum:
.sheet { --scrollsheet-center-max-inline: 720px;}--scrollsheet-center-gutter (default 20px) is the minimum gap from the
viewport edge on small screens, independent of the width you choose.
Keyboard
Section titled “Keyboard”A centered dialog with a text input shifts above the on-screen keyboard automatically, using
--scrollsheet-keyboard. No extra prop is needed.
Dismissal
Section titled “Dismissal”Escape and a backdrop click both dismiss, same as every other side. dismissible,
escapeDismissible, and backdropDismissible all work unchanged.
No-<dialog> fallback
Section titled “No-<dialog> fallback”Browsers without <dialog> support use a fixed-position fallback (see
Browser support). It has no zoom animation, top-layer
stacking, or native focus containment.
Center vs. a bottom sheet
Section titled “Center vs. a bottom sheet”Use center for short dialogs such as confirmations, single-field forms, or alerts. Use a
bottom or side sheet for draggable flows and longer scrollable content.
side="center" applies at every viewport width. To keep a bottom sheet on mobile and center it
on desktop, add desktopSide="center". See Responsive profiles.