Skip to main content

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 from resources/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, use DialogScrollContent:

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

Options:
  • side: 'top' | 'right' | 'bottom' | 'left'
  • align: 'start' | 'center' | 'end'
Contextual menus for actions:

Context Menu

Right-click menu:

Tooltip

Short hints on hover:

Toast Notifications

Using vue-sonner for toast notifications:
Make sure to include the Sonner component in your layout:

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

  1. Dialog vs Sheet - Use dialogs for critical actions, sheets for contextual content
  2. Always include titles - Required for accessibility
  3. Limit dialog content - Keep dialogs focused and concise
  4. Use confirmation dialogs - For destructive actions
  5. Manage focus - Ensure focus moves appropriately
  6. Close on success - Programmatically close after successful form submission
  7. Toast duration - Keep messages brief and auto-dismiss
  8. Dropdown positioning - Ensure dropdowns don’t overflow viewport