Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Modal
  3. API and Development

Dialog

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Dialog displays a dialog overlay that focuses user attention on specific content or actions, typically used for confirmations, forms, or important information. It provides a flexible dialog interface with header, content, and footer sections, supporting confirmations, cancellations, and various interaction patterns. Built with portal rendering and animation support, it ensures consistent modal patterns across the interface with full keyboard and screen reader accessibility.
Props
NameDefaultDescription
idrequiredUnique identifier for the modal. Used with Dialog to manage modal state.
headingrequiredThe heading text displayed at the top of the modal.
childrenrequiredThe content to display inside the modal body.
onConfirmrequiredCallback function called when the confirm button is clicked: () => void.
onConfirmText"Confirm"Text to display on the confirm button. LocalizedMessage—copy from formatMessage.
onCancelOptional callback function called when the cancel button is clicked: () => void.
onCancelText"Cancel"Text to display on the cancel button. Only shown when onCancel is provided. LocalizedMessage—copy from formatMessage.
noDismissfalseWhether the modal can be dismissed by clicking the backdrop or dismiss button.
shouldAllowDismissCalled before backdrop or header-X dismiss. Return false to keep the modal open.
confirmDisabledfalseWhether the confirm button should be disabled.
closeOnConfirmtrueWhether the modal should close automatically when the confirm button is clicked.
destructivefalseWhether the modal should use destructive styling for the confirm button.
Basic Dialog
Use for simple confirmations or information dialogs.
Single Button Dialog
Use when only confirmation is needed, without a cancel option.
Destructive Dialog
Use for actions that have significant consequences or cannot be undone.
Dialog with Custom Button Text
Customize button labels to match the action context.
Non-Dismissible Dialog
Prevent users from closing the modal until they complete the action.
Dialog with Disabled Confirm
Disable the confirm button until form validation or conditions are met.
Dialog That Stays Open on Confirm
Keep the modal open after confirmation for multi-step processes or validation feedback.
Dialog with Scrollable Content
Use Scrollable component for modals with long content.
Multiple Modals
Support multiple modals that can be stacked or opened simultaneously.
Dialog Setup
Wrap your application with Dialog and include Portal to enable modal functionality.
Dialog Hook
Use the Dialog hook to control modal visibility (open, close, isOpen).
Previous
Modal / Usage
Next
Accessibility / Focus Management
On this page
Props
Basic Dialog
Single Button Dialog
Destructive Dialog
Dialog with Custom Button Text
Non-Dismissible Dialog
Dialog with Disabled Confirm
Dialog That Stays Open on Confirm
Dialog with Scrollable Content
Multiple Modals
Dialog Setup
Dialog Hook