$ rezi
Widgets

Dialog

Declarative dialog sugar over ui.modal(...) for message + action flows.

Declarative dialog sugar over ui.modal(...) for message + action flows.

Usage

ui.dialog({
  id: "confirm",
  title: "Delete Item",
  message: "This cannot be undone.",
  onClose: close,
  actions: [
    { label: "Cancel", onPress: close },
    { label: "Delete", intent: "danger", onPress: handleDelete },
  ],
})

Props

ui.dialog(...) accepts modal-like props plus message + declarative actions.

PropTypeDefaultDescription
idstringrequiredDialog identifier
titlestring-Optional dialog title
messagestring | VNoderequiredDialog body content
actionsDialogAction[]requiredDeclarative action list
onClose() => void-Close callback
initialFocusstring-Focus target on open
returnFocusTostring-Focus target on close
closeOnBackdropbooleantrueClose on backdrop click
closeOnEscapebooleantrueClose on Esc

DialogAction shape:

FieldTypeDescription
idstringOptional action button id (auto-generated when omitted)
labelstringButton label
intent"primary" | "danger"Button intent hint
onPress() => voidAction callback
disabledbooleanOptional disabled state
focusablebooleanOptional focus opt-out

Intent behavior

action.intent is respected when rendering dialog actions. This means declarative dialog actions map through to button intents in the generated modal action row.

On this page