# Overlays **Prerequisite**: All overlays require `` wrapper in app root. **Important:** v4.4.0 includes security fixes for XSS vulnerabilities in Banner and CommandPalette components. Upgrade recommended. ## Toast (Notifications) ### Basic Usage ```vue ``` ### Toast Options ```ts toast.add({ id: 'unique-id', // Custom ID (auto-generated if omitted) title: 'Title', // Toast title description: 'Details', // Toast body color: 'success', // primary, success, error, warning, info icon: 'i-heroicons-check', // Left icon avatar: { src: '...' }, // Avatar instead of icon timeout: 5000, // Auto-dismiss (0 = never) actions: [{ // Action buttons label: 'Undo', click: () => {} }], callback: () => {} // Called on dismiss }) ``` ### Toast Types ```ts // Success toast.add({ title: 'Saved', color: 'success', icon: 'i-heroicons-check-circle' }) // Error toast.add({ title: 'Error', color: 'error', icon: 'i-heroicons-x-circle' }) // Warning toast.add({ title: 'Warning', color: 'warning', icon: 'i-heroicons-exclamation-triangle' }) // Info toast.add({ title: 'Info', color: 'info', icon: 'i-heroicons-information-circle' }) // Remove toast toast.remove('toast-id') // Clear all toast.clear() ``` ## Modal ### Basic Modal ```vue ``` ### Modal Props ```vue description="Subtitle" :close="true" :close-icon="'i-heroicons-x-mark'" :overlay="true" :transition="true" :prevent-close="false" fullscreen > ``` ### Programmatic Modal (useOverlay) ```vue ``` ## Slideover Side panel overlay (from edge of screen). ```vue ``` ### Slideover Props ```vue :overlay="true" :transition="true" :prevent-close="false" > ``` ## Drawer Bottom sheet overlay (vaul-vue). ```vue ``` ### Drawer Props ```vue :should-scale-background="true" :close-threshold="0.25" > ``` ## Popover ```vue Open Popover ``` ### Popover Props ```vue align="center" :arrow="true" :delay="{ open: 0, close: 0 }" > ``` ## Tooltip ```vue Hover me ``` ## DropdownMenu ```vue ``` ### Nested Items ```vue ``` ## ContextMenu Right-click menu. ```vue
Right-click here
``` ## CommandPalette Search-driven command menu (Fuse.js powered). ```vue ``` ### CommandPalette Props (v4.4+) ```vue :input="{ /* props */ }" /> ``` ### Keyboard Shortcut ```vue ``` ## Best Practices | Do | Don't | | -------------------------------------- | --------------------------- | | Use useToast for notifications | Build custom toast systems | | Use UModal for dialogs | Use alerts for complex UI | | Use Slideover for panels | Use modals for side content | | Use Drawer for mobile sheets | Use slideover on mobile | | Use CommandPalette for search | Build custom search UI | | Use programmatic overlays for confirms | Create confirm components |