Component Interaction Patterns
Detailed interaction patterns for common UI components, with attention to user goals, meaning, and error prevention.
Table of Contents
Pattern Philosophy
Before implementing any pattern, ask:
- What is the user's goal? Not "use this component" but "accomplish this task"
- Is this component necessary? Could we eliminate it entirely?
- What errors might occur? How do we prevent or recover from them?
- What should the user feel? Confidence? Delight? Relief?
Components are means, not ends. The best component is often no component at all.
Forms & Inputs
User Goal Context
Users filling forms rarely want to "fill a form." They want to:
- Complete a purchase
- Submit an application
- Update their settings
- Send a message
Every field is friction. Eliminate fields that don't directly serve the goal.
Text Inputs
States & Meaning
| State |
Appearance |
Emotional Tone |
| Empty |
Placeholder, subtle border |
Ready, inviting |
| Focused |
Ring/outline, cursor |
Engaged, active |
| Filled |
Value visible |
Progressing |
| Error |
Red indicator, message below |
Recoverable, guided |
| Disabled |
Reduced opacity |
Unavailable (explain why) |
| Valid |
Green check (optional) |
Confidence, progress |
Error Prevention
- Use input constraints (type="email", maxlength)
- Auto-format as user types (phone numbers, credit cards)
- Show format hints before errors occur
- Validate on blur, re-validate on change after error
- Never clear user input on error
Label Patterns
- Always use visible labels (not placeholder-only)
- Float label: compact, modern feel
- Static label: clearest, most accessible
- Associate labels with inputs (
for/id) for screen readers
Keyboard
- Tab: next field
- Shift+Tab: previous field
- Enter: submit (single-line) or next field
- Escape: blur, optionally revert
Textareas
- Auto-grow height as content grows (with max-height)
- Character count for limited fields (shows remaining, not error at limit)
- Resize handle if appropriate
Checkboxes & Radio Buttons
Goal context: Selection is a micro-commitment. Make the commitment clear.
Checkbox States
- Unchecked → Checked → (Indeterminate for mixed children)
- Click anywhere on label to toggle
- Focus ring on control, not label
Radio Groups
- Arrow keys navigate between options
- Only one radio receives Tab focus
- Selection can follow focus (faster) or require explicit activation (safer for consequential choices)
Form Layout
Single Column (default)
- Labels above inputs for easy scanning
- Group related fields with spacing or dividers
- Primary action left-aligned (right in RTL)
Progressive Disclosure
- Show only required fields initially
- Reveal optional/advanced fields on demand
- Don't overwhelm; respect the user's attention
Error Summary
- On submit failure, summarize errors at top
- Link each error to its field
- Focus the summary or first error
Modals & Dialogs
When to Use Modals
Use modals when:
- User must make a decision before continuing
- Action is destructive and needs confirmation
- Context isolation reduces errors (complex wizards)
- System requires exclusive attention (authentication)
Avoid modals when:
- User needs to reference content behind the modal
- Trial-and-error adjustment is needed (use inline/inspector)
- Action can easily be undone (use undo, not confirmation)
- You're using a modal because it's "easy" to implement
Modal Types & User Goals
| Type |
User Goal |
Design Priorities |
| Alert |
Understand a situation |
Clear message, single action |
| Confirm |
Make a consequential decision |
Clear stakes, distinct options |
| Prompt |
Provide a single piece of info |
Fast completion, clear purpose |
| Form |
Complete a multi-step task |
Progress visibility, save state |
| Drawer |
Access details/settings |
Easy dismiss, no obstruction |
Opening
- Animate from trigger element (connection) or center (focus)
- Duration: 200-300ms ease-out
- Focus first interactive element or close button
- Prevent background scroll
Focus Management (Critical)
1. Store previous focus location
2. Move focus into modal (first focusable element)
3. Trap focus within modal (Tab cycles through)
4. On close, restore focus to trigger element
Closing
- Close button (X) always visible
- Escape key closes (unless destructive action in progress)
- Backdrop click closes (configurable—disable for critical confirmations)
- Warn on unsaved changes: "You have unsaved changes. Discard?"
Error Handling in Modals
- If form submission fails, keep modal open
- Show errors inline within the modal
- Don't close on error—user loses context
Stacking Modals
Avoid when possible. Stacking modals indicates a flow design problem.
If truly necessary:
- Each modal gets its own backdrop layer
- Escape closes topmost only
- Focus trapped in topmost
- Consider: should this be a multi-step wizard instead?
Dropdowns & Menus
User Goal Context
Dropdowns present choices. The goal is to make the right choice quickly and confidently.
Activation
- Click to open (not hover—accessibility requirement)
- Enter/Space opens when trigger focused
- Arrow Down opens and selects first item
Keyboard Navigation
| Key |
Action |
| ↓ |
Next item |
| ↑ |
Previous item |
| Home |
First item |
| End |
Last item |
| Enter/Space |
Select current item |
| Escape |
Close, return focus to trigger |
| Type character |
Jump to item starting with that character |
Positioning
- Default: below trigger
- Flip if insufficient space
- Maintain 8px from viewport edges
Menu Item Design
| State |
Appearance |
Notes |
| Default |
Normal text |
— |
| Hover/Focus |
Background highlight |
— |
| Selected |
Checkmark |
For current value |
| Disabled |
Reduced opacity |
Skip in keyboard nav |
| Destructive |
Red text |
delete, remove |
Error Prevention
- Disable unavailable options (don't hide them—explain why)
- For long lists, add search/filter
- Group related items with headers
- Show selected value in trigger (never unclear state)
Nested Menus
- Open on hover with 200ms delay
- Arrow Right opens submenu
- Arrow Left closes submenu
- Safe triangle for diagonal mouse movement
Drag & Drop
User Goal Context
Drag and drop enables direct manipulation—physically moving objects. The goal is natural, intuitive rearrangement.
Signifiers (Affordances Made Visible)
- Drag handle: grip icon (⋮⋮) or entire item
- Cursor:
grab on hover, grabbing during drag
- Lift effect on drag start (shadow + slight scale)
During Drag
Visual Feedback
- Ghost/preview following cursor (semi-transparent)
- Placeholder in original position
- Valid drop zones highlighted
- Invalid zones dimmed or unchanged
- Insertion indicator (line) shows where item will land
Auto-Scroll
- Scroll container when dragging near edges
- Accelerate near very edge
Drop Feedback
- Animate item into new position (200-300ms)
- Remove ghost immediately
- Brief highlight on dropped item (confirmation)
Keyboard Alternative (Required)
- Space: select item for move
- Arrow keys: navigate through positions
- Space/Enter: drop at current position
- Escape: cancel move, return to original
Multi-Item Drag
- Badge showing count ("3 items")
- Visual stack of selected items
- All items move as unit
Error Recovery
- Undo for accidental drops
- Escape cancels during drag
- Clear visual state if drop fails
Lists & Tables
User Goal Context
Lists and tables help users find, compare, and act on items. Goals include:
- Find a specific item
- Compare items to make a choice
- Perform actions on one or multiple items
- Understand patterns across data
Selection
Single Select
- Click to select
- Arrow keys move selection
- Enter activates selected item
Multi-Select
- Click toggles individual selection
- Shift+Click for range
- Cmd/Ctrl+Click for non-contiguous
- Checkbox column for explicit multi-select
Sorting
- Click column header to sort
- Click again to reverse
- Visual indicator (arrow) shows sort state
- Remember sort preference (if appropriate)
Filtering
- Filter controls above list
- Instant filtering (debounce 150-300ms)
- Show count: "23 of 156 items"
- Clear all filters button when active
- Preserve filters across sessions (if appropriate)
Empty States (Dramatic Moments)
| State |
Narrative |
Design |
| Initial empty |
"Your story hasn't begun" |
Invitation, clear CTA to add first item |
| No results (filter) |
"Nothing matches" |
Suggestion to adjust filters, link to clear |
| Error |
"Something went wrong" |
Empathy, retry button, explain if possible |
| Cleared/Complete |
"All done!" |
Celebration if appropriate, next steps |
Row Actions
- Hover actions: appear on row hover
- Context menu: right-click or overflow (⋮)
- Swipe actions: mobile (always provide undo)
- Inline edit: click cell to edit
Infinite Scroll / Virtualization
- Load more 2-3 screens before bottom
- Show loading indicator during fetch
- Maintain scroll position on data updates
- Virtualize for performance (render only visible)
Navigation
User Goal Context
Navigation helps users understand where they are and how to get where they want to go. The goal is orientation and confidence.
Tab Navigation
- Tabs as
role="tablist" with role="tab" children
- Arrow keys move between tabs
- Tab/Shift+Tab exits tablist
- Active tab:
aria-selected="true", clear visual indicator
Breadcrumbs
What they communicate: "You are here, and here's how you got here."
- Current page: text only (not a link)
- Separator between items (/ or >)
- Truncate middle items with "..." for long paths
- Click any ancestor to navigate up
Pagination
- Show current page and total
- Previous/Next buttons (disabled at bounds)
- Direct page input for large page counts
- Consider: is pagination better than infinite scroll for this use case?
Sidebar Navigation
- Collapsible: icon-only or full labels
- Nested items: expand/collapse with disclosure
- Current item: strong visual indicator
- Keyboard: Arrow keys navigate, Enter activates
Search
User Goal Context
Search users have a target in mind. Help them find it quickly, or learn it doesn't exist.
Search Input
- Magnifying glass icon (left, signifies purpose)
- Clear button (right, appears when filled)
- Escape clears and closes results
- Placeholder suggests what can be searched
Instant Search
- Debounce input (150-300ms)
- Show loading state in results area
- Minimum characters (2-3) before searching
- Highlight matching text in results
Search Results
- Show count: "12 results for 'widget'"
- Group by type if mixed content
- No results: helpful suggestions, check spelling
- Recent searches when input empty
Command Palette
- Open: Cmd/Ctrl+K
- Fuzzy matching on command names
- Recent commands at top
- Category headers
- Keyboard-first: arrows + Enter
Notifications & Toasts
User Goal Context
Notifications inform users of events they didn't directly trigger. The goal is awareness without disruption.
When to Notify
Notify for:
- Completion of background tasks
- Important state changes
- Errors requiring attention
- Time-sensitive information
Don't notify for:
- Every action the user just performed (use inline feedback)
- Low-importance information
- Marketing messages (unless explicitly opted in)
Positioning
- Top-right or bottom-right (most common)
- Top-center for critical alerts
- Stack vertically with 8-12px gap
- New notifications push others
Auto-Dismiss Timing
| Type |
Duration |
Auto-dismiss? |
Rationale |
| Success |
3-5s |
Yes |
Confirmation, low urgency |
| Info |
5-7s |
Yes |
Awareness, low urgency |
| Warning |
7-10s |
Optional |
May need action |
| Error |
Persistent |
No |
Requires attention |
Interaction
- Hover pauses auto-dismiss
- Close button always visible
- Action button: "Undo", "View", "Retry"
- Swipe to dismiss (mobile)
Animation
- Enter: slide + fade (200-300ms)
- Exit: fade + slide (150-200ms)
- Stack reflow: animate position changes
Tooltips & Popovers
Tooltips
Purpose: Provide helpful context for ambiguous elements.
When to use:
- Icon-only buttons needing labels
- Truncated text needing full display
- Form fields needing clarification
When NOT to use:
- Critical information (use visible labels)
- Mobile-primary interfaces (hover-triggered)
- Lengthy content (use popovers)
Behavior:
- Show on hover after 300-500ms delay
- Hide immediately on mouse leave
- Show on focus for keyboard users
- Position: above by default, flip if clipped
- Content: text only, 1-2 lines max
Popovers
Purpose: Provide interactive content in context.
- Trigger: click (not hover)
- Can contain interactive elements
- Dismiss: click outside, Escape, explicit close
- Arrow pointing to trigger
- Focus trap if contains form elements
Sliders & Range Inputs
User Goal Context
Sliders let users explore a value space. The goal is finding the right value through direct manipulation.
When Sliders Excel
- Imprecise values where "about right" suffices
- Exploring a range to see effects
- Values that benefit from relative positioning
When Text Input is Better
- Precise values needed (type "24px" vs. drag to 24)
- Very large ranges
- Values with specific meaningful numbers
Single Value Slider
- Thumb: 20-24px minimum (44px for touch)
- Track: filled portion shows progress to value
- Value label: above thumb or in tooltip during drag
- Tick marks for discrete/meaningful values
Range Slider
- Two thumbs, independently draggable
- Thumbs cannot cross
- Filled track between thumbs
Keyboard (Required)
- ← / →: decrease/increase by step
- Page Up/Down: larger jumps
- Home/End: min/max values
Accessibility
role="slider" with aria-valuemin, aria-valuemax, aria-valuenow
aria-valuetext for human-readable: "50%" or "$500"
- Announce value changes
Date & Time Pickers
User Goal Context
Users selecting dates are usually scheduling something or filtering by time. The goal is choosing the right date quickly and confidently.
Date Picker
Input States
- Text input with format hint (MM/DD/YYYY or locale-appropriate)
- Calendar icon triggers picker
- Support manual typing for power users
Calendar View
- Month/year header with navigation
- Day grid with weekday headers
- Today: highlighted (subtle)
- Selected: filled/prominent
- Disabled: dimmed (past dates, unavailable slots)
Keyboard
- Arrow keys navigate days
- Page Up/Down: months
- Home/End: first/last of month
- Enter: select and close
Date Range Picker
- Two inputs or single with separator
- Visual range highlight in calendar
- Click start, then end
- Presets: "Last 7 days", "This month"
Time Picker
- Input with format hint
- Dropdown with intervals (15-30 min)
- Allow manual entry for precise times
Error Prevention
- Disable unavailable dates (don't let users select then show error)
- Clear format hints
- Accept multiple input formats, normalize display
- Show timezone clearly when relevant
1---2name: 1279-component-patterns-81c1b1353description: Component Interaction Patterns4---5# Component Interaction Patterns67Detailed interaction patterns for common UI components, with attention to user goals, meaning, and error prevention.89## Table of Contents10- [Pattern Philosophy](#pattern-philosophy)11- [Forms & Inputs](#forms--inputs)12- [Modals & Dialogs](#modals--dialogs)13- [Dropdowns & Menus](#dropdowns--menus)14- [Drag & Drop](#drag--drop)15- [Lists & Tables](#lists--tables)16- [Navigation](#navigation)17- [Search](#search)18- [Notifications & Toasts](#notifications--toasts)19- [Tooltips & Popovers](#tooltips--popovers)20- [Sliders & Range Inputs](#sliders--range-inputs)21- [Date & Time Pickers](#date--time-pickers)2223---2425## Pattern Philosophy2627Before implementing any pattern, ask:281. **What is the user's goal?** Not "use this component" but "accomplish this task"292. **Is this component necessary?** Could we eliminate it entirely?303. **What errors might occur?** How do we prevent or recover from them?314. **What should the user feel?** Confidence? Delight? Relief?3233Components are means, not ends. The best component is often no component at all.3435---3637## Forms & Inputs3839### User Goal Context4041Users filling forms rarely want to "fill a form." They want to:42- Complete a purchase43- Submit an application44- Update their settings45- Send a message4647Every field is friction. Eliminate fields that don't directly serve the goal.4849### Text Inputs5051**States & Meaning**52| State | Appearance | Emotional Tone |53|-------|------------|----------------|54| Empty | Placeholder, subtle border | Ready, inviting |55| Focused | Ring/outline, cursor | Engaged, active |56| Filled | Value visible | Progressing |57| Error | Red indicator, message below | Recoverable, guided |58| Disabled | Reduced opacity | Unavailable (explain why) |59| Valid | Green check (optional) | Confidence, progress |6061**Error Prevention**62- Use input constraints (type="email", maxlength)63- Auto-format as user types (phone numbers, credit cards)64- Show format hints before errors occur65- Validate on blur, re-validate on change after error66- Never clear user input on error6768**Label Patterns**69- Always use visible labels (not placeholder-only)70- Float label: compact, modern feel71- Static label: clearest, most accessible72- Associate labels with inputs (`for`/`id`) for screen readers7374**Keyboard**75- Tab: next field76- Shift+Tab: previous field77- Enter: submit (single-line) or next field78- Escape: blur, optionally revert7980### Textareas8182- Auto-grow height as content grows (with max-height)83- Character count for limited fields (shows remaining, not error at limit)84- Resize handle if appropriate8586### Checkboxes & Radio Buttons8788**Goal context:** Selection is a micro-commitment. Make the commitment clear.8990**Checkbox States**91- Unchecked → Checked → (Indeterminate for mixed children)92- Click anywhere on label to toggle93- Focus ring on control, not label9495**Radio Groups**96- Arrow keys navigate between options97- Only one radio receives Tab focus98- Selection can follow focus (faster) or require explicit activation (safer for consequential choices)99100### Form Layout101102**Single Column** (default)103- Labels above inputs for easy scanning104- Group related fields with spacing or dividers105- Primary action left-aligned (right in RTL)106107**Progressive Disclosure**108- Show only required fields initially109- Reveal optional/advanced fields on demand110- Don't overwhelm; respect the user's attention111112**Error Summary**113- On submit failure, summarize errors at top114- Link each error to its field115- Focus the summary or first error116117---118119## Modals & Dialogs120121### When to Use Modals122123**Use modals when:**124- User must make a decision before continuing125- Action is destructive and needs confirmation126- Context isolation reduces errors (complex wizards)127- System requires exclusive attention (authentication)128129**Avoid modals when:**130- User needs to reference content behind the modal131- Trial-and-error adjustment is needed (use inline/inspector)132- Action can easily be undone (use undo, not confirmation)133- You're using a modal because it's "easy" to implement134135### Modal Types & User Goals136137| Type | User Goal | Design Priorities |138|------|-----------|-------------------|139| Alert | Understand a situation | Clear message, single action |140| Confirm | Make a consequential decision | Clear stakes, distinct options |141| Prompt | Provide a single piece of info | Fast completion, clear purpose |142| Form | Complete a multi-step task | Progress visibility, save state |143| Drawer | Access details/settings | Easy dismiss, no obstruction |144145### Opening146147- Animate from trigger element (connection) or center (focus)148- Duration: 200-300ms ease-out149- Focus first interactive element or close button150- Prevent background scroll151152### Focus Management (Critical)153154```1551. Store previous focus location1562. Move focus into modal (first focusable element)1573. Trap focus within modal (Tab cycles through)1584. On close, restore focus to trigger element159```160161### Closing162163- Close button (X) always visible164- Escape key closes (unless destructive action in progress)165- Backdrop click closes (configurable—disable for critical confirmations)166- Warn on unsaved changes: "You have unsaved changes. Discard?"167168### Error Handling in Modals169170- If form submission fails, keep modal open171- Show errors inline within the modal172- Don't close on error—user loses context173174### Stacking Modals175176**Avoid when possible.** Stacking modals indicates a flow design problem.177178If truly necessary:179- Each modal gets its own backdrop layer180- Escape closes topmost only181- Focus trapped in topmost182- Consider: should this be a multi-step wizard instead?183184---185186## Dropdowns & Menus187188### User Goal Context189190Dropdowns present choices. The goal is to make the right choice quickly and confidently.191192### Activation193194- Click to open (not hover—accessibility requirement)195- Enter/Space opens when trigger focused196- Arrow Down opens and selects first item197198### Keyboard Navigation199200| Key | Action |201|-----|--------|202| ↓ | Next item |203| ↑ | Previous item |204| Home | First item |205| End | Last item |206| Enter/Space | Select current item |207| Escape | Close, return focus to trigger |208| Type character | Jump to item starting with that character |209210### Positioning211212- Default: below trigger213- Flip if insufficient space214- Maintain 8px from viewport edges215216### Menu Item Design217218| State | Appearance | Notes |219|-------|------------|-------|220| Default | Normal text | — |221| Hover/Focus | Background highlight | — |222| Selected | Checkmark | For current value |223| Disabled | Reduced opacity | Skip in keyboard nav |224| Destructive | Red text | delete, remove |225226### Error Prevention227228- Disable unavailable options (don't hide them—explain why)229- For long lists, add search/filter230- Group related items with headers231- Show selected value in trigger (never unclear state)232233### Nested Menus234235- Open on hover with 200ms delay236- Arrow Right opens submenu237- Arrow Left closes submenu238- Safe triangle for diagonal mouse movement239240---241242## Drag & Drop243244### User Goal Context245246Drag and drop enables direct manipulation—physically moving objects. The goal is natural, intuitive rearrangement.247248### Signifiers (Affordances Made Visible)249250- Drag handle: grip icon (⋮⋮) or entire item251- Cursor: `grab` on hover, `grabbing` during drag252- Lift effect on drag start (shadow + slight scale)253254### During Drag255256**Visual Feedback**257- Ghost/preview following cursor (semi-transparent)258- Placeholder in original position259- Valid drop zones highlighted260- Invalid zones dimmed or unchanged261- Insertion indicator (line) shows where item will land262263**Auto-Scroll**264- Scroll container when dragging near edges265- Accelerate near very edge266267### Drop Feedback268269- Animate item into new position (200-300ms)270- Remove ghost immediately271- Brief highlight on dropped item (confirmation)272273### Keyboard Alternative (Required)274275- Space: select item for move276- Arrow keys: navigate through positions277- Space/Enter: drop at current position278- Escape: cancel move, return to original279280### Multi-Item Drag281282- Badge showing count ("3 items")283- Visual stack of selected items284- All items move as unit285286### Error Recovery287288- Undo for accidental drops289- Escape cancels during drag290- Clear visual state if drop fails291292---293294## Lists & Tables295296### User Goal Context297298Lists and tables help users find, compare, and act on items. Goals include:299- Find a specific item300- Compare items to make a choice301- Perform actions on one or multiple items302- Understand patterns across data303304### Selection305306**Single Select**307- Click to select308- Arrow keys move selection309- Enter activates selected item310311**Multi-Select**312- Click toggles individual selection313- Shift+Click for range314- Cmd/Ctrl+Click for non-contiguous315- Checkbox column for explicit multi-select316317### Sorting318319- Click column header to sort320- Click again to reverse321- Visual indicator (arrow) shows sort state322- Remember sort preference (if appropriate)323324### Filtering325326- Filter controls above list327- Instant filtering (debounce 150-300ms)328- Show count: "23 of 156 items"329- Clear all filters button when active330- Preserve filters across sessions (if appropriate)331332### Empty States (Dramatic Moments)333334| State | Narrative | Design |335|-------|-----------|--------|336| Initial empty | "Your story hasn't begun" | Invitation, clear CTA to add first item |337| No results (filter) | "Nothing matches" | Suggestion to adjust filters, link to clear |338| Error | "Something went wrong" | Empathy, retry button, explain if possible |339| Cleared/Complete | "All done!" | Celebration if appropriate, next steps |340341### Row Actions342343- Hover actions: appear on row hover344- Context menu: right-click or overflow (⋮)345- Swipe actions: mobile (always provide undo)346- Inline edit: click cell to edit347348### Infinite Scroll / Virtualization349350- Load more 2-3 screens before bottom351- Show loading indicator during fetch352- Maintain scroll position on data updates353- Virtualize for performance (render only visible)354355---356357## Navigation358359### User Goal Context360361Navigation helps users understand where they are and how to get where they want to go. The goal is orientation and confidence.362363### Tab Navigation364365- Tabs as `role="tablist"` with `role="tab"` children366- Arrow keys move between tabs367- Tab/Shift+Tab exits tablist368- Active tab: `aria-selected="true"`, clear visual indicator369370### Breadcrumbs371372**What they communicate:** "You are here, and here's how you got here."373374- Current page: text only (not a link)375- Separator between items (/ or >)376- Truncate middle items with "..." for long paths377- Click any ancestor to navigate up378379### Pagination380381- Show current page and total382- Previous/Next buttons (disabled at bounds)383- Direct page input for large page counts384- Consider: is pagination better than infinite scroll for this use case?385386### Sidebar Navigation387388- Collapsible: icon-only or full labels389- Nested items: expand/collapse with disclosure390- Current item: strong visual indicator391- Keyboard: Arrow keys navigate, Enter activates392393---394395## Search396397### User Goal Context398399Search users have a target in mind. Help them find it quickly, or learn it doesn't exist.400401### Search Input402403- Magnifying glass icon (left, signifies purpose)404- Clear button (right, appears when filled)405- Escape clears and closes results406- Placeholder suggests what can be searched407408### Instant Search409410- Debounce input (150-300ms)411- Show loading state in results area412- Minimum characters (2-3) before searching413- Highlight matching text in results414415### Search Results416417- Show count: "12 results for 'widget'"418- Group by type if mixed content419- No results: helpful suggestions, check spelling420- Recent searches when input empty421422### Command Palette423424- Open: Cmd/Ctrl+K425- Fuzzy matching on command names426- Recent commands at top427- Category headers428- Keyboard-first: arrows + Enter429430---431432## Notifications & Toasts433434### User Goal Context435436Notifications inform users of events they didn't directly trigger. The goal is awareness without disruption.437438### When to Notify439440**Notify for:**441- Completion of background tasks442- Important state changes443- Errors requiring attention444- Time-sensitive information445446**Don't notify for:**447- Every action the user just performed (use inline feedback)448- Low-importance information449- Marketing messages (unless explicitly opted in)450451### Positioning452453- Top-right or bottom-right (most common)454- Top-center for critical alerts455- Stack vertically with 8-12px gap456- New notifications push others457458### Auto-Dismiss Timing459460| Type | Duration | Auto-dismiss? | Rationale |461|------|----------|---------------|-----------|462| Success | 3-5s | Yes | Confirmation, low urgency |463| Info | 5-7s | Yes | Awareness, low urgency |464| Warning | 7-10s | Optional | May need action |465| Error | Persistent | No | Requires attention |466467### Interaction468469- Hover pauses auto-dismiss470- Close button always visible471- Action button: "Undo", "View", "Retry"472- Swipe to dismiss (mobile)473474### Animation475476- Enter: slide + fade (200-300ms)477- Exit: fade + slide (150-200ms)478- Stack reflow: animate position changes479480---481482## Tooltips & Popovers483484### Tooltips485486**Purpose:** Provide helpful context for ambiguous elements.487488**When to use:**489- Icon-only buttons needing labels490- Truncated text needing full display491- Form fields needing clarification492493**When NOT to use:**494- Critical information (use visible labels)495- Mobile-primary interfaces (hover-triggered)496- Lengthy content (use popovers)497498**Behavior:**499- Show on hover after 300-500ms delay500- Hide immediately on mouse leave501- Show on focus for keyboard users502- Position: above by default, flip if clipped503- Content: text only, 1-2 lines max504505### Popovers506507**Purpose:** Provide interactive content in context.508509- Trigger: click (not hover)510- Can contain interactive elements511- Dismiss: click outside, Escape, explicit close512- Arrow pointing to trigger513- Focus trap if contains form elements514515---516517## Sliders & Range Inputs518519### User Goal Context520521Sliders let users explore a value space. The goal is finding the right value through direct manipulation.522523### When Sliders Excel524525- Imprecise values where "about right" suffices526- Exploring a range to see effects527- Values that benefit from relative positioning528529### When Text Input is Better530531- Precise values needed (type "24px" vs. drag to 24)532- Very large ranges533- Values with specific meaningful numbers534535### Single Value Slider536537- Thumb: 20-24px minimum (44px for touch)538- Track: filled portion shows progress to value539- Value label: above thumb or in tooltip during drag540- Tick marks for discrete/meaningful values541542### Range Slider543544- Two thumbs, independently draggable545- Thumbs cannot cross546- Filled track between thumbs547548### Keyboard (Required)549550- ← / →: decrease/increase by step551- Page Up/Down: larger jumps552- Home/End: min/max values553554### Accessibility555556- `role="slider"` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow`557- `aria-valuetext` for human-readable: "50%" or "$500"558- Announce value changes559560---561562## Date & Time Pickers563564### User Goal Context565566Users selecting dates are usually scheduling something or filtering by time. The goal is choosing the right date quickly and confidently.567568### Date Picker569570**Input States**571- Text input with format hint (MM/DD/YYYY or locale-appropriate)572- Calendar icon triggers picker573- Support manual typing for power users574575**Calendar View**576- Month/year header with navigation577- Day grid with weekday headers578- Today: highlighted (subtle)579- Selected: filled/prominent580- Disabled: dimmed (past dates, unavailable slots)581582**Keyboard**583- Arrow keys navigate days584- Page Up/Down: months585- Home/End: first/last of month586- Enter: select and close587588### Date Range Picker589590- Two inputs or single with separator591- Visual range highlight in calendar592- Click start, then end593- Presets: "Last 7 days", "This month"594595### Time Picker596597- Input with format hint598- Dropdown with intervals (15-30 min)599- Allow manual entry for precise times600601### Error Prevention602603- Disable unavailable dates (don't let users select then show error)604- Clear format hints605- Accept multiple input formats, normalize display606- Show timezone clearly when relevant