Overview
SaaS Starter Vue includes several overlay components for displaying content on top of the main interface. All components are built with reka-ui for full accessibility and keyboard navigation support.Dialog (Modal)
Dialogs are modal overlays that require user interaction before dismissing.Basic Dialog
Dialog with Form
Dialogs commonly contain forms for user input:Confirmation Dialog
Example fromresources/js/components/DeleteUser.vue:40-111:
Dialog Components
- Dialog - Root component that manages state
- DialogTrigger - Button or element that opens the dialog
- DialogContent - Container for dialog content with overlay
- DialogHeader - Header section for title and description
- DialogTitle - Main heading (required for accessibility)
- DialogDescription - Supporting text
- DialogFooter - Footer section for actions
- DialogClose - Button to close dialog
- DialogOverlay - Background overlay (included in DialogContent)
Controlled Dialog
Manage dialog state externally:Scrollable Dialog
For long content, useDialogScrollContent:
Hide Close Button
Remove the X close button:Sheet (Slide-over)
Sheets slide in from the edge of the screen:Sheet Sides
Sheets can slide from different sides:Popover
Non-modal overlay for displaying content:Popover Positioning
- side:
'top' | 'right' | 'bottom' | 'left' - align:
'start' | 'center' | 'end'
Dropdown Menu
Contextual menus for actions:Dropdown with Shortcuts
Context Menu
Right-click menu:Tooltip
Short hints on hover:Toast Notifications
Using vue-sonner for toast notifications:Toast with Actions
Accessibility
All overlay components include:- Focus management - Focus is trapped within dialogs
- Keyboard navigation - ESC to close, Tab to navigate
- ARIA attributes - Proper roles and labels
- Screen reader support - Announcements and descriptions
- Focus restoration - Focus returns to trigger on close
Best Practices
- Dialog vs Sheet - Use dialogs for critical actions, sheets for contextual content
- Always include titles - Required for accessibility
- Limit dialog content - Keep dialogs focused and concise
- Use confirmation dialogs - For destructive actions
- Manage focus - Ensure focus moves appropriately
- Close on success - Programmatically close after successful form submission
- Toast duration - Keep messages brief and auto-dismiss
- Dropdown positioning - Ensure dropdowns don’t overflow viewport