Modal

Centered dialog overlay — confirm layouts and wide forms.

Preview

Live

Variants

Wide

.modal-dialog--wide for longer forms.

Confirm block

.modal-confirm text + detail + actions.

Accessibility

  • Dialog needs role="dialog", aria-modal="true", and a labelled title.
  • Backdrop and close controls need accessible names (backdropLabel / label).
  • Escape closes (React Modal); return focus to the opener in the host app.
  • Move initial focus into the dialog when opened.

API

HTML classes

Class Description
.modal-root / .is-open Fixed overlay root.
.modal-backdrop Dismiss click target.
.modal-dialog / --wide Dialog panel (+ wide).
.modal-head / .modal-title / .modal-close Header chrome.
.modal-body Scrollable body.
.modal-confirm / __text / __detail Confirm copy layout.

React props

From src/core/Modal.tsx — compound Modal* components + useModalTitleId.

Prop Type Default Description
open / onOpenChange boolean / fn Modal controlled state.
backdropLabel string Required accessible name for backdrop.
wide boolean false ModalDialog wide modifier.
labelledBy / label string Dialog accessible name.
text / detail ReactNode ModalConfirm copy.
label string ModalClose aria-label (required).