Dialog
Blocking and non-blocking overlay container.
Also known as:
- Modal
- Confirm Dialog
- Feedback
- Inline Dialog
- Inline Message
- Callout
- Highlight
- Hint
- Note
- Callout card
- Dialogue
- Highlight box
- Highlighter
- Input dialog
- Notes
- Notice
- User feedback
- Modal Dialog
- Pop-up Dialog
- Alert Dialog
- Confirmation Dialog
Overview
Purpose
The Dialog component blocking and non-blocking overlay container.within our design system. It follows our composer layer principles, ensuring consistency and reusability across applications.
When to Use
- Use when you need organizing content
- Appropriate for containers contexts
- Follows composer component patterns
When Not to Use
- Avoid when simpler alternatives exist
- Don't use for interactive elements
- Consider alternatives for edge cases
Live Example
Anatomy
Understanding the structure of the Dialog component helps ensure proper implementation and customization.
| Property | Description | Type |
|---|---|---|
| root | Outermost container that hosts the component. | Root |
| body | Body region of the component. | Slot |
| closeButton | Close button region of the component. | Slot |
| footer | Footer region of the component. | Slot |
| header | Header region of the component. | Slot |
| title | Title region of the component. | Slot |
| backdrop | Backdrop region of the component. | Part |
| modal | When true (default), renders a modal dialog with backdrop and focus trap. When false, renders a non-modal dialog. | boolean | undefined |
| close | Close region of the component. | Part |
Variants & States
API Reference
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
modal | boolean | No | true | — |
size | DialogSize | No | 'md' | — |
className | string | No | '' | — |
children | React.ReactNode | Yes | '×' | — |
onClose | () => void | No | — | — |
closeOnBackdropClick | boolean | No | true | — |
closeOnEscape | boolean | No | true | — |
initialFocus | string | No | — | — |
returnFocus | string | No | — | — |
Accessibility
Standards Compliance
This component follows WCAG 2.1 AA guidelines and includes proper ARIA attributes, keyboard navigation, and screen reader support.
Common Pitfalls
- Not trapping focus
- poor mobile handling
- misuse for inline content.
Accessibility Checklist
- ○ Keyboard navigation support
- ○ Screen reader compatibility
- ○ Color contrast compliance
- ○ Focus management
- ○ ARIA attributes
- ○ Reduced motion support
Usage Guidelines
✓ Do
- Use consistent spacing and sizing
- Follow established patterns
- Provide clear labels and descriptions
- Test with assistive technologies
✗ Don't
- Override core functionality
- Use without proper context
- Ignore accessibility requirements
- Modify without design system approval
Examples
Advanced Usage
Complex patterns including composition, state management, and real-world scenarios.
Development Tools
Use these tools to analyze the component's performance, design tokens, and accessibility during development.
Contribute
Help us improve the Dialog component documentation. Found an issue or have suggestions?