sheengemologic ui
All components

Dialog

Opens a scoped modal with a focus trap and focus restoration.@gemologic/sheen · overlays

Playground

<Dialog title="Workspace settings" trigger="Open settings"><Input label="Name" /></Dialog>

Variant matrix

Scoped modal

Anatomy

Package
@gemologic/sheen
Source
packages/ui/src/primitives/Dialog.tsx
Tokens
  • --sheen-color-bg-raised
  • --sheen-color-bg-overlay
  • --sheen-elevation-modal

Accessibility

Role: dialogKeyboard: Tab, Shift+Tab, Escape

Do

  • Mount inside the theme scope whose colors the overlay should inherit.

Do not

  • Do not portal overlays to document.body.

Generated props

NameTypeDefaultDescription
title *string—Accessible dialog title.
contentIdstring—Optional stable content element ID for an external aria-controls relationship. Must be unique in the document.
triggerstring—Visible label for the opening button.
descriptionstring—Optional explanatory text associated with the dialog.
openboolean—Controlled open state; rejected close requests retain the modal.
defaultOpenbooleanfalseUncontrolled initial open state; portal content mounts when the theme target is ready.
onOpenChange(open: boolean) => void—Requests a change in open state without mutating controlled ownership.
dismissiblebooleantrueAllows Escape, outside press, and the close action; false disables all three.
closeLabelstring—Visible and accessible close-action label; defaults to the scoped close message.
initialFocus() => HTMLElement | undefined—Resolves an enabled focus target inside the mounted dialog.
returnFocus() => HTMLElement | undefined—Optional surviving focus target after closing, useful for triggerless dialogs.
shortcutScopestring—Unique modal shortcut scope ID, defaulting to an internal stable ID. Within ShortcutProvider, opening suspends outer scopes automatically. Register modal actions under this ID; do not reuse an application/global scope.
classstring—Additional classes on modal content.
footerJSX.Element—App-owned footer actions beside the built-in close action.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.