Modal

Accessible dialog overlay using native <dialog> element

Category: overlay · WCAG 2.2-AA · overlay, dialog, popup, ai

Sizes

States

Props

PropTypeDefaultDescription
openbooleanfalseWhether the component is open (controlled).
onClose() => void—Called when the component is closed.
titlestring—Title text for the component.
descriptionstring—Supporting description text.
size'sm' | 'md' | 'lg'mdVisual size of the component (e.g. 'sm', 'md', 'lg').
footerReactNode—Dialog actions, rendered in a right-aligned row below the body and separated by a divider.
draggablebooleanfalseAllow dragging the dialog by its header
aiboolean | 'generating'falseAI presence: `true` gives the surface an AI-tinted edge and a soft aura, marking AI-generated content; `'generating'` adds a pulsing inner glow while AI is still producing it (stops under reduced motion). Visual only — pair it with an AiBadge so the provenance is also text.
childrenReactNode—Modal body content

Design tokens

When to use

When not to use

How to build an accessible Modal in React →

Examples

Basic modal

<Modal open={isOpen} onClose={() => setIsOpen(false)} title="Confirm action">
  <p>Are you sure?</p>
</Modal>

Related components

← Back to docs