Skip to main content
Design/interaction-pattern-library

Interaction Pattern Library

You need to catalog and specify interaction patterns for consistency.

Use this when you need to document the interaction patterns a product uses (or should use) -- loading behaviors, state transitions, feedback mechanisms, progressive disclosure, and microinteractions. Produces a pattern catalog that designers and engineers reference for consistency.

Related skills: Use /component-spec for individual component documentation. Pair with /design-review to evaluate pattern usage in designs. Use /style-guide for foundational design tokens.

Process

Step 1: Gather inputs

Ask the user to provide:

  1. Product or feature area -- what are we cataloging patterns for?
  2. Scope -- full product audit or specific flows?
  3. Existing patterns -- does the team have documented patterns? What's inconsistent?
  4. Design system -- is there a component library these patterns should align with?
  5. Platform -- web, mobile, or both? (Interaction patterns differ by platform)

Step 2: Identify patterns in use

Walk through the product or designs and catalog every distinct interaction pattern:

## Interaction Pattern Inventory -- {{product name}}

### Loading patterns

| Pattern | Where used | Implementation | Consistent? |
|---------|-----------|---------------|-------------|
| Spinner (blocking) | (screens) | (duration, placement) | Yes / No |
| Skeleton screen | (screens) | (shape matches content?) | Yes / No |
| Progressive loading | (screens) | (above-fold first, rest lazy) | Yes / No |
| Optimistic update | (actions) | (show success, rollback on failure) | Yes / No |
| Background refresh | (data) | (silent update, no UI disruption) | Yes / No |

### Feedback patterns

| Pattern | Where used | Implementation | Consistent? |
|---------|-----------|---------------|-------------|
| Toast notification | (actions) | (position, duration, dismissible?) | Yes / No |
| Inline validation | (forms) | (on blur, on submit, or real-time?) | Yes / No |
| Success confirmation | (actions) | (animation, text, auto-dismiss?) | Yes / No |
| Error display | (failures) | (inline, banner, modal?) | Yes / No |
| Progress indicator | (multi-step) | (bar, steps, percentage?) | Yes / No |

### Disclosure patterns

| Pattern | Where used | Implementation | Consistent? |
|---------|-----------|---------------|-------------|
| Accordion/expand | (content) | (single or multi-expand?) | Yes / No |
| Tooltip | (help text) | (hover, click, or focus trigger?) | Yes / No |
| Popover | (details) | (trigger, dismissal, mobile behavior?) | Yes / No |
| Modal/dialog | (decisions) | (focus trap, backdrop, escape to close?) | Yes / No |
| Drawer/panel | (secondary content) | (push or overlay? Responsive behavior?) | Yes / No |

### Navigation patterns

| Pattern | Where used | Implementation | Consistent? |
|---------|-----------|---------------|-------------|
| Tab switching | (content) | (keyboard arrows, URL updates?) | Yes / No |
| Pagination | (lists) | (numbered, load more, infinite scroll?) | Yes / No |
| Back/undo | (actions) | (browser back, in-app back, undo?) | Yes / No |
| Search/filter | (collections) | (instant, debounced, submit?) | Yes / No |

Step 3: Specify standard patterns

For each pattern category, define the standard behavior the product should follow:

## Pattern Specification: {{Pattern name}}

**When to use:** (Scenario that calls for this pattern)
**When NOT to use:** (Common misapplication)

### Behavior
- **Trigger:** (What initiates the pattern)
- **Duration:** (How long it lasts -- timing in ms if animated)
- **Transition:** (How it appears/disappears -- fade, slide, instant)
- **Dismissal:** (How the user exits -- click outside, escape, timer, explicit close)

### States
| State | Visual | Behavior |
|-------|--------|----------|
| Entering | (how it appears) | (what happens on entry) |
| Active | (steady state) | (user can interact with...) |
| Exiting | (how it leaves) | (what happens on exit) |

### Accessibility
- **Keyboard:** (how to trigger and dismiss)
- **Screen reader:** (what's announced)
- **Motion:** (respects prefers-reduced-motion?)

### Platform variations
| Platform | Difference |
|----------|-----------|
| Desktop | (default behavior) |
| Mobile | (touch-specific adaptation -- e.g., bottom sheet instead of dropdown) |

Step 4: Identify inconsistencies

## Consistency Report

### Inconsistencies found

| Pattern | Location A | Location B | Difference | Recommendation |
|---------|-----------|-----------|-----------|----------------|
| (pattern) | (screen) | (screen) | (how they differ) | Standardize to (version) |

### Missing patterns
- (Interaction that currently has no defined pattern -- e.g., "no standard for bulk selection")

Step 5: Review

Ask the user:

  • Are these the right standard patterns for your product?
  • Any patterns I missed or miscategorized?
  • Does the team prefer any of the inconsistent implementations over others?
  • Should I spec individual components from these patterns using /component-spec?

Output location

Present the pattern library as formatted text in the conversation. For design system documentation, export to Notion, Storybook, or the team's pattern docs.

Example Output

Input

  • Product or feature area: Meridian Health — patient-facing web app covering appointment booking, lab results, and secure messaging with care teams
  • Scope: Full product audit across all three feature areas
  • Existing patterns: Informal Figma component library exists but interaction behaviors are undocumented; engineering has noticed three different toast implementations and two different loading approaches across the app
  • Design system: Internal "Meridian DS" built on top of Radix UI primitives; tokens are defined but motion/timing values are not
  • Platform: Responsive web (desktop + mobile), no native apps

Output (abbreviated)

Interaction Pattern Library — Meridian Health Web App


Interaction Pattern Inventory

Loading Patterns

PatternWhere UsedImplementationConsistent?
Spinner (blocking)Appointment submission, message sendCentered overlay, no timeout definedNo
Skeleton screenLab results list, appointment historyShape approximates content on results; generic bars on appointmentsNo
Progressive loadingLab results detail (PDF preview)Above-fold data loads first; PDF lazyYes
Optimistic updateMessage sendNot implemented — waits for server confirmationNo
Background refreshLab results (polling for new results)Silent, no UI disruptionYes

Feedback Patterns

PatternWhere UsedImplementationConsistent?
Toast notificationAppointment confirmed, message sent, form errors3 implementations: top-right (booking), bottom-center (messaging), inline banner (lab results)No
Inline validationAppointment booking form, profile settingsOn-submit only in booking; real-time in profileNo
Success confirmationAppointment bookedCheckmark animation + auto-dismiss at 4sYes
Error displayAPI failuresMix of modal (booking), inline banner (lab results), and console-only (messaging)No
Progress indicatorMulti-step booking flowStep tracker (3 steps), no percentageYes

Disclosure Patterns

PatternWhere UsedImplementationConsistent?
AccordionLab result reference ranges, FAQSingle-expand only; no keyboard arrow supportNo
TooltipForm field help text, lab result flagsHover-only; breaks on mobile touchNo
Modal/dialogAppointment cancel confirmation, document uploadFocus trap present in cancel; missing in uploadNo
Drawer/panelMessaging thread detail on mobileOverlay (not push); no swipe-to-dismissNo

Pattern Specification: Toast Notification

When to use: Confirm a completed action (message sent, appointment booked, file uploaded) or surface a non-blocking system error that does not prevent the user from continuing.

When NOT to use: Critical errors requiring user action (use an inline error or modal instead). Do not use for persistent status like a degraded-service warning (use a banner).

Behavior

  • Trigger: Action completion or system event (API response received)
  • Duration: 5000ms for success/info; persistent (manual dismiss) for errors
  • Transition: Slide up + fade in (200ms ease-out); slide down + fade out (150ms ease-in)
  • Dismissal: Auto-dismiss on timer, or explicit close via × button; Escape key closes active toast

States

StateVisualBehavior
EnteringSlides up from bottom-right, opacity 0→1Pushes existing toasts upward; stacks max 3
ActiveSteady display with icon, message, and close buttonUser can click a link action if present (e.g., "View appointment")
ExitingSlides down, opacity 1→0Stack reflows; lower toasts slide down to fill space

Accessibility

  • Keyboard: Escape dismisses focused toast; Tab moves focus into toast if it contains an action link
  • Screen reader: role="status" for success/info; role="alert" for errors; message announced on entry
  • Motion: Slide animation skipped when prefers-reduced-motion: reduce; fade only

Platform Variations

PlatformBehavior
Desktop (≥1024px)Bottom-right, 320px wide, stacks vertically
Mobile (<1024px)Bottom-center, full-width minus 16px margin each side; single toast visible at a time

Pattern Specification: Inline Form Validation

When to use: Any form with fields where the validity of input can be evaluated before submission (email format, required fields, date constraints).

When NOT to use: Search inputs or filters where partial input is expected and normal.

Behavior

  • Trigger: On blur (field loses focus) for format validation; on change (debounced 300ms) only for fields with a character counter or real-time constraint (e.g., message length)
  • Duration: Persistent until field is corrected
  • Transition: Error message fades in (150ms); field border transitions to --color-error-border in 100ms
  • Dismissal: Clears on blur after valid input is entered

States

StateVisualBehavior
UntouchedDefault border, no messageNo validation runs
Valid--color-success-border, optional checkmark iconCheckmark shown only on high-stakes fields (e.g., DOB, insurance ID)
Invalid--color-error-border, red helper text below fieldError message replaces helper text; does not shift layout (reserved space)

Accessibility

  • Keyboard: Error message associated via aria-describedby; field marked aria-invalid="true"
  • Screen reader: Error announced on blur; not announced on every keystroke
  • Motion: No animation for error state — transition is color only

Consistency Report

Inconsistencies Found

PatternLocation ALocation BDifferenceRecommendation
Toast positionAppointment Booking (top-right)Secure Messaging (bottom-center)Position and entry direction differStandardize to bottom-right desktop / bottom-center mobile per spec above
Loading — skeleton vs. spinnerLab Results list (skeleton)Appointment History list (spinner, blocking)Skeleton is less disruptive for list contentMigrate Appointment History to skeleton screen
Form validation timingProfile Settings (real-time)Appointment Booking (on-submit only)On-submit delays error feedback; increases correction effortStandardize to on-blur across all forms
Modal focus trapCancel Appointment (present)Document Upload (absent)Keyboard users can tab outside upload modalAudit all modals; add focus trap via Radix Dialog primitive consistently
Tooltip triggerLab Results flags (hover)None on mobileHover-only tooltips are inaccessible on touchSwitch to click/focus trigger with a visible tap target; consider replacing with inline help text for mobile

Missing Patterns

  • Bulk selection — No defined pattern for selecting multiple lab results or messages for bulk action (archive, download). Recommend adding a checkbox-select pattern with a sticky bulk-action bar.
  • Empty states — No standard for zero-result views in messaging or lab results (no illustration, copy, or CTA guidance).
  • Undo / destructive action recovery — Appointment cancellation is final with no undo window. Recommend a 5-second undo toast pattern before the cancellation is committed server-side.
  • Optimistic updates for messaging — Currently blocking; spec an optimistic-send pattern with rollback on failure to reduce perceived latency.

Open Questions for Team Review

  • Should the bulk-selection pattern be prioritized for the next sprint given the upcoming "Download Records" feature?
  • Engineering preference on toast stack behavior — should new toasts appear on top or bottom of the stack?
  • Does the design team want to keep the step-tracker progress indicator in booking, or migrate to a percentage bar to accommodate future flows with variable step counts?
  • Should I generate a /component-spec for the Toast and Modal components to lock down the Radix implementation details?