Modal

Accessible dialog overlay using native <dialog> element

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

Sizes

States

Props

PropTypeDefaultDescription
openbooleanfalseWhether the component is open (controlled).
onClose() => voidCalled when the component is closed.
titlestringTitle text for the component.
descriptionstringSupporting description text.
size'sm' | 'md' | 'lg'mdVisual size of the component (e.g. 'sm', 'md', 'lg').
draggablebooleanfalseAllow dragging the dialog by its header

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