Skip to content

Dialog ​

A window overlaid on the primary window, rendering the content underneath inert. Closes with the backdrop, the back gesture / key, Esc or SDialogClose.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Controlled ​

Bind open state with !! like v-model:open.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SDialog ​

shadcn-vue Dialog.

PropTypeDefaultDescription
open!!boolean | undefinedundefinedControlled open state (use with !!). Leave undefined for uncontrolled.
defaultOpenbooleanfalse
EventTypeDefaultDescription
onOpenChange(open: boolean) => void() => { }

Slots: children (trailing closure)

SDialogTrigger ​

Opens the dialog when its content is tapped.

Slots: children (trailing closure)

SDialogClose ​

Closes the dialog when its content is tapped (works inside the dialog content).

Slots: children (trailing closure)

SDialogContent ​

The dialog panel. Renders nothing in place; while open it is shown in an overlay layer.

  • pointer / wide screens: centred bg-background rounded-lg border p-6 shadow-lg sm:max-w-lg
  • touch + compact window (adaptive: 'auto'): bottom Drawer with a drag handle (semantic translation)
PropTypeDefaultDescription
showCloseButtonbooleantrue
dismissOnOutsidebooleantrueClose when tapping the backdrop.
adaptiveSparkAdaptive
SparkAdaptive = 'auto' | 'pointer' | 'touch'
'auto''auto': Drawer on compact touch screens, centred dialog otherwise.
tokensSparkSurfaceTokens{}Per-instance surface token overrides (instance → theme tokens → recipe), see {@link SparkSurfaceTokens}.

Slots: children (trailing closure)

SDialogHeader ​

Slots: children (trailing closure)

SDialogFooter ​

Actions row; stacks vertically (primary on top) on compact width, like shadcn's flex-col-reverse sm:flex-row.

Slots: children (trailing closure)

SDialogTitle ​

PropTypeDefaultDescription
textResourceStr''

SDialogDescription ​

PropTypeDefaultDescription
textResourceStr''

MIT Licensed