sheengemologic ui
All components

AlertDialog

An interrupting modal with required explanation and explicit dismissal.@gemologic/sheen · overlays

Playground

<AlertDialog title="Remove workspace?" description="This removes the workspace and its saved views." trigger="Review removal" closeLabel="Keep workspace" />

Variant matrix

Review a destructive operation

Anatomy

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

Accessibility

Role: alertdialogKeyboard: Tab, Shift+Tab, Escape

Do

  • Keep initial focus on the safe action for destructive decisions.

Do not

  • Do not use alert dialogs for routine nonblocking status messages.

Generated props

NameTypeDefaultDescription
description *stringRequired explanatory text associated with the alert dialog.
title *stringAccessible dialog title.
contentIdstringOptional stable content element ID for an external aria-controls relationship. Must be unique in the document.
triggerstringVisible label for the opening button.
openbooleanControlled open state; rejected close requests retain the modal.
defaultOpenbooleanfalseUncontrolled initial open state; portal content mounts when the theme target is ready.
onOpenChange(open: boolean) => voidRequests a change in open state without mutating controlled ownership.
dismissiblebooleantrueAllows Escape, outside press, and the close action; false disables all three.
closeLabelstringVisible and accessible close-action label; defaults to the scoped close message.
initialFocus() => HTMLElement | undefinedResolves an enabled focus target inside the mounted dialog.
returnFocus() => HTMLElement | undefinedOptional surviving focus target after closing, useful for triggerless dialogs.
shortcutScopestringUnique 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.
classstringAdditional classes on modal content.
footerJSX.ElementApp-owned footer actions beside the built-in close action.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.