Animated Dialog
Use Animated Dialog for a modal task that needs an accessible dialog foundation and a short directional entrance. It provides the dialog structure, focus management, and close behavior while leaving the content and actions to your application.
Preview
Basic usage
Examples
Direction
Set from and exitTo when the dialog should enter and leave in a particular direction. Use the center direction for a scale and fade treatment.
Controlled state
Use open and onOpenChange when another part of the interface needs to control the dialog state.
Usage
API
| Property | Type | Default | Description |
|---|---|---|---|
children | ReactNode | required | |
open | boolean | — | |
defaultOpen | boolean | false | Initial open state for uncontrolled usage. |
onOpenChange | (open: boolean) => void | — | |
modal | boolean | true | Whether the dialog traps interaction inside the modal. |
Accessibility
The component uses Base UI dialog semantics, including focus management, Escape dismissal, and accessible labels. Include a title and description that clearly explain the task before asking someone to act.
Styling
Style the content and action controls with class name options. Reduced-motion preferences replace directional movement with a simpler transition.
Contact
Found a bug or need help using this component? Open an issue on GitHub.
License & Usage
Sona UI is available under the MIT license. You may use, modify, and distribute this component in personal and commercial projects.
Was this page helpful?
Your response helps us improve component docs.