Skip to content

Dialog

Centered modal overlay with scrim, header/body/footer slots, and optional footer actions via .actions array.

HTML tag: c-e026f5ae83afb49438fec45f75b8fedf2

  • modal confirmation or form in center overlay
  • blocking alert or edit dialog
  • not for side panels (use ab-drawer)
PropTypeDefaultDescription
openBooleanfalse
typeStringbasic
titleString
show_closeBooleantrue
resizableBooleanfalse
actionsArray
is_maximizedBooleanfalse
close_on_escBooleantrue
close_on_scrimBooleantrue
aria_labelString
aria_labelledbyString
aria_describedbyString
width_smString280px
width_mdString560px
width_lgString720px
max_heightString80vh
panel_radiusStringvar(--ab-radius-lg)
panel_bgStringvar(--ab-color-surface-base)
panel_fgStringvar(--ab-color-text-primary)
panel_borderStringnone
panel_shadowStringvar(--ab-shadow-3)
transition_durationStringvar(--ab-motion-duration-3)
transition_ease_inStringvar(--ab-motion-ease-in)
transition_ease_outStringvar(--ab-motion-ease-out)
scrim_colorStringrgba(0,0,0,0.35)
scrim_blurString0px
scrim_transition_durationStringvar(--ab-motion-duration-3)
z_indexNumber10010
selected_action_idString
contentString
panel_topString20%
panel_transformStringtranslate(-50%, 0)
  • Control with .open or methods show/hide/toggle.
  • type: basic | alert | fullscreen (use basic, not standard).
  • Content in default slot; footer via .actions array (ab-actions) or footer slot.
  • All events use oneDB fireEvent shape: read handler payload as e.detail.value (never e.detail directly).
  • ab-dialog:action detail is e.detail.value with { id, role, meta } — use e.detail.value.id to branch on custom action ids.
  • Only actions with role confirm/cancel (or id confirm/cancel) auto-close via confirm()/cancel(); custom ids (run, apply, close, etc.) do NOT auto-close — keep .open true in the parent handler.
  • close_on_esc and close_on_scrim control dismiss; set both false while async work is in progress.
  • Sync parent state on @ab-dialog:hide (sets open=false internally).
EventDetail
ab-dialog:show
ab-dialog:hide
ab-dialog:confirmvalue: [object Object]
ab-dialog:cancelvalue: [object Object]
ab-dialog:actionvalue: [object Object]
SignatureDescription
show()
hide()
toggle()
confirm()
cancel()
focus_first()
maximize_panel()
restore_panel_size()

Do not use for navigation shell (ab-page-template or ab-drawer permanent). Do not nest multiple open dialogs without clear UX. Do not read e.detail.actionId or e.detail.id — always e.detail.value.id. Do not assume custom footer actions close the dialog.

<c-e026f5ae83afb49438fec45f75b8fedf2 .open=${open} .title=${'Confirm'} .type=${'alert'} .actions=${actions} @ab-dialog:action=${(e) => { const id = e.detail?.value?.id; if (id === 'confirm') onOk(); }} @ab-dialog:hide=${() => open = false}>...</c-e026f5ae83afb49438fec45f75b8fedf2>