Modal

Feedback

A dialog overlay that focuses user attention on a task or confirmation. Use sparingly.

Preview

Props API

PropTypeDefaultDescription
titlestring"Confirm action"Dialog heading
descriptionstring"Are you sure you want to proceed? This cannot be undone."Dialog body content
sizeselect"sm" | "md" | "lg" | "full""md"Width of the dialog
showFooterbooleantrueDisplays action buttons in the footer
closeOnOverlaybooleantrueCloses the modal when clicking the backdrop

Usage

Use modals only when an action requires immediate attention or confirmation. For simple messages, prefer an inline alert or toast. Always provide a clearly labeled way to dismiss.

Accessibility

  • Uses role="dialog" with aria-modal="true".

  • Focus is trapped inside the modal while it is open.

  • Pressing Escape closes the dialog.

  • Focus returns to the triggering element when the modal closes.