Skip to content

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.

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.

A centered dialog with a text input shifts above the on-screen keyboard automatically, using --scrollsheet-keyboard. No extra prop is needed.

Escape and a backdrop click both dismiss, same as every other side. dismissible, escapeDismissible, and backdropDismissible all work unchanged.

Browsers without <dialog> support use a fixed-position fallback (see Browser support). It has no zoom animation, top-layer stacking, or native focus containment.

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.