Dialog
Modal dialog with focus trap, Escape to close and focus return.
Install this component
Install command hidden until you are signed in with a license.
Live demo
Props
| Prop | Type | Description |
|---|---|---|
| open | boolean | Controlled open state. |
| onClose | () => void | Called on Escape, close button or backdrop. |
| title | string | Accessible name. |
| description | string | Optional description. |
| dismissOnBackdrop | booleandefault true | Close when the backdrop is clicked. |
Accessibility
Keyboard
- EscapeClose
- Tab / Shift+TabCycle focus inside the dialog
ARIA and semantics
- role=dialog with aria-modal
- aria-labelledby and aria-describedby
- Focus moves in on open and returns to the trigger on close
Source
Copy the files into your project. Or install with the commands above (they unlock with your license).
The full Dialog source is part of the license.
The live demo is free to try. A license unlocks copy-paste source, installs and exports for every component and pack.
Unlock every icon