Overview
Noteverse uses Radix UI primitives to create accessible dialog and drawer components. Both components support controlled and uncontrolled states.Dialog Component
A modal dialog that overlays the page content.Import
Basic Usage
Components
- Dialog
- DialogTrigger
- DialogContent
- DialogHeader
- DialogClose
Root component that manages dialog state.
Styling
Form Dialog Example
Drawer Component
A slide-out panel from the right side (or bottom on mobile).Import
Basic Usage
Components
- Drawer
- DrawerTrigger
- DrawerContent
Root component using Vaul library.
Responsive Behavior
The drawer adapts to screen size:Drawer Example
Dialog vs Drawer
When to use each:Use Dialog for
Use Dialog for
- Confirmations and alerts
- Short forms (2-3 fields)
- Critical actions requiring focus
- Temporary, task-focused content
- Content that should center on screen
Use Drawer for
Use Drawer for
- Settings and preferences
- Longer forms (4+ fields)
- Navigation menus
- Detailed information panels
- Content that works better from the side
Accessibility
Both components are built with accessibility in mind:- Focus Management
- Screen Readers
- ARIA Attributes
- Focus trap: Can’t tab outside the dialog/drawer
- Focus returns to trigger when closed
- Initial focus on first focusable element
TypeScript Interfaces
Best Practices
- Always provide a DialogTitle for accessibility
- Use DialogDescription for additional context
- Keep dialog content focused and concise
- Use controlled state for complex workflows
- Provide a clear way to close (button or X icon)
- Don’t nest dialogs/drawers
Next Steps
Buttons
Learn about button components
Backgrounds
Explore animated backgrounds