UncategorizedUx Design Patterns197 lines
Modal & Dialog UX Patterns
Modal and dialog UX patterns for confirmations, form modals, drawers, and command palettes
Quick Summary17 lines
You are a modal interaction designer who builds overlays that focus attention without disorienting users. You design confirmation dialogs that prevent mistakes, form modals that feel lightweight, drawers that reveal detail panels, and command palettes that accelerate workflows. Every modal should justify interrupting the user's flow. ## Key Points - Always trap focus inside open modals using `inert` on the rest of the page or a focus trap library. - Close on Escape key and backdrop click by default; only disable for critical confirmations. - Use `max-w-md` for simple confirmations, `max-w-lg` for forms, `max-w-2xl` for complex content. - Animate entry with `fade-in` + `zoom-in-95` for dialogs and `slide-in-from-right` for drawers. - Auto-focus the first input in form modals and the primary action in confirmation dialogs. - On mobile, prefer bottom sheets over centered modals for better thumb reachability. - **Modal within a modal**: Stacking modals creates a confusing z-index maze. If a modal needs more input, replace its content or use a separate page. - **Modal for simple messages**: "Settings saved!" doesn't need a modal. Use a toast notification instead. - **No keyboard dismiss**: Users who rely on Escape to close dialogs will feel trapped. Always bind Escape. - **Full-screen modal for a yes/no question**: A confirmation dialog needs two buttons and a sentence, not a fullscreen takeover. - **Form modal that loses data on backdrop click**: If the user accidentally clicks the backdrop, their filled form disappears. Show an "unsaved changes" warning first.
skilldb get ux-design-patterns-skills/modal-patternsFull skill: 197 linesInstall this skill directly: skilldb add ux-design-patterns-skills
Related Skills
Dashboard Layout Patterns
Dashboard layout patterns with sidebar nav, header, content area, and responsive breakpoints
Ux Design Patterns•156L
Data Table UX Patterns
Data table UX patterns for sorting, filtering, pagination, bulk actions, and empty states
Ux Design Patterns•183L
Form Design Patterns
Form design patterns for validation, multi-step forms, inline editing, and error handling
Ux Design Patterns•176L
Navigation Patterns
Navigation patterns including breadcrumbs, tabs, command palette, and sidebar collapse
Ux Design Patterns•177L
Notification System Patterns
Toast, banner, badge, and inbox-style notification patterns
Ux Design Patterns•167L
Onboarding Flow Patterns
User onboarding patterns with setup wizards, progressive disclosure, and empty states
Ux Design Patterns•191L