guide

Dialog Behavior

Shared attributes and focus/Esc behavior inherited by every dialog-based component.

Dialog-based components share one behavior set: lazy mount on first open, teleport to document.body (unless inline), page scroll lock, a focus trap, Esc to close, and focus restore to the opener.

AttributeEffect
openOpen on first render; stays in sync with show/hide.
centerVertically center the panel.
containerContained overlay presentation.
fullFull-screen overlay presentation.
stackAllow stacked dialogs instead of hiding the others.
inlineKeep the component in its original DOM position.
no-bg-closeIgnore clicks on the overlay background.
no-esc-closeIgnore the Esc key.
unmountRemove the rendered DOM after closing.
dialog-rolePanel role: dialog or alertdialog.
<button type="button" class="z-button z-button-primary" data-toggle="#cmd-dialog">Open centered</button>

<z-cmd id="cmd-dialog" center no-esc-close>
  <select data-fn="data-source" hidden>
    <optgroup label="Actions">
      <option value="confirm">Confirm</option>
    </optgroup>
  </select>
</z-cmd>