mcpField
I
interaction-patterns

interaction-patterns

github.com/yonatangrossDesign & UI299154 installsUpdated today
Repository

About interaction-patterns

A UI design skill for teams defining interaction behavior. It provides practical patterns for loading, navigation, forms, overlays, and notifications, with accessibility and keyboard alternatives built in.

Key features

  1. 01Loading-state selection guidance
  2. 02Accessible pagination and infinite scroll
  3. 03Progressive disclosure and overlay patterns
  4. 04Keyboard alternatives for drag and drop
  5. 05Form, tab, and notification guidance
  6. 06Dark-pattern detection principles

Use cases

  1. 01Choose loading feedback for async content
  2. 02Design accessible long-content navigation
  3. 03Select a modal, drawer, or inline pattern
  4. 04Review forms and notifications for usability

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/yonatangross/orchestkit --skill interaction-patterns

After installing, type/interaction-patternsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

test-cases.json
references/
keyboard-interaction-matrix.md
interaction-pattern-catalog.md
loading-states-decision-tree.md
rules/
_sections.md
_template.md
interaction-cognitive-load-thresholds.md
interaction-form-ux.md
interaction-infinite-scroll.md
interaction-drag-drop.md
interaction-persuasion-ethics.md
interaction-modal-drawer-inline.md
interaction-skeleton-loading.md
interaction-tabs-overflow.md
interaction-toast-notifications.md
interaction-progressive-disclosure.md

Details

From the project README

Interaction Patterns

Codifiable UI interaction patterns that prevent common UX failures. Covers loading states, content pagination, disclosure patterns, overlays, drag-and-drop, tab overflow, and notification systems — all with accessibility baked in.

Quick Reference

RuleFileImpactWhen to Use
Skeleton Loadingrules/interaction-skeleton-loading.mdHIGHContent-shaped placeholders for async data
Infinite Scrollrules/interaction-infinite-scroll.mdCRITICALPaginated content with a11y and keyboard support
Progressive Disclosurerules/interaction-progressive-disclosure.mdHIGHRevealing complexity based on user need
Modal / Drawer / Inlinerules/interaction-modal-drawer-inline.mdHIGHChoosing overlay vs inline display patterns
Drag & Droprules/interaction-drag-drop.mdCRITICALReorderable lists with keyboard alternatives
Tabs Overflowrules/interaction-tabs-overflow.mdMEDIUMTab bars with 7+ items or dynamic tabs
Toast Notificationsrules/interaction-toast-notifications.mdHIGHSuccess/error feedback and notification stacking
Cognitive Load Thresholdsrules/interaction-cognitive-load-thresholds.mdHIGHEnforcing Miller's Law, Hick's Law, and Doherty Threshold with numeric limits
Form UXrules/interaction-form-ux.mdHIGHTarget sizing, label placement, error prevention, and smart defaults
Persuasion Ethicsrules/interaction-persuasion-ethics.mdHIGHDetecting dark patterns and applying ethical engagement principles

Total: 10 rules across 6 categories

Decision Table — Loading States

ScenarioPatternWhy
List/card content loadingSkeletonMatches content shape, reduces perceived latency
Form submissionSpinnerIndeterminate, short-lived action
File uploadProgress barMeasurable operation with known total
Image loadingBlur placeholderPrevents layout shift, progressive reveal
Route transitionSkeletonPreserves layout while data loads
Background syncNone / subtle indicatorNon-blocking, low priority

Quick Start

Skeleton Loading
function CardSkeleton() {
  return (
    <div className="animate-pulse space-y-3">
      <div className="h-48 w-full rounded-lg bg-muted" />
      <div className="h-4 w-3/4 rounded bg-muted" />
      <div className="h-4 w-1/2 rounded bg-muted" />
    </div>
  )
}

function CardList({ items, isLoading }: { items: Item[]; isLoading: boolean }) {
  if (isLoading) {
    return (
      <div className="grid grid-cols-3 gap-4">
        {Array.from({ length: 6 }).map((_, i) => (
          <CardSkeleton key={i} />
        ))}
      </div>
    )
  }
  return (
    <div className="grid grid-cols-3 gap-4">
      {items.map((item) => <Card key={item.id} item={item} />)}
    </div>
  )
}
Infinite Scroll with Accessibility
function InfiniteList({ fetchNextPage, hasNextPage, items }: Props) {
  const sentinelRef = useRef<HTMLDivElement>(null)

  useEffect(() => {
    const observer = new IntersectionObserver(
      ([entry]) => { if (entry.isIntersecting && hasNextPage) fetchNextPage() },
      { rootMargin: "200px" }
    )
    if (sentinelRef.current) observer.observe(sentinelRef.current)
    return () => observer.disconnect()
  }, [fetchNextPage, hasNextPage])

  return (
    <div role="feed" aria-busy={isFetching}>
      {items.map((item) => (
        <article key={item.id} aria-posinset={item.index} aria-setsize={-1}>
          <ItemCard item={item} />
        </article>
      ))}
      <div ref={sentinelRef} />
      {hasNextPage && (
        <button onClick={() => fetchNextPage()}>Load more items</button>
      )}
      <div aria-live="polite" className="sr-only">
        {`Showing ${items.length} items`}
      </div>
    </div>
  )
}

Rule Details

Skeleton Loading

Content-shaped placeholders that match the final layout. Use skeleton for lists, cards, and text blocks.

Load: rules/interaction-skeleton-loading.md

Infinite Scroll

Accessible infinite scroll with IntersectionObserver, screen reader announcements, and "Load more" fallback.

Load: rules/interaction-infinite-scroll.md

Progressive Disclosure

Reveal complexity progressively: tooltip, accordion, wizard, contextual panel.

Load: rules/interaction-progressive-disclosure.md

Modal / Drawer / Inline

Choose the right overlay pattern: modal for confirmations, drawer for detail views, inline for simple toggles.

Load: rules/interaction-modal-drawer-inline.md

Drag & Drop

Drag-and-drop with mandatory keyboard alternatives using @dnd-kit/core.

Load: rules/interaction-drag-drop.md

Tabs Overflow

Scrollable tab bars with overflow menus for dynamic or numerous tabs.

Load: rules/interaction-tabs-overflow.md

Toast Notifications

Positioned, auto-dismissing notifications with ARIA roles and stacking.

Load: rules/interaction-toast-notifications.md

Cognitive Load Thresholds

Miller's Law (max 7 items per group), Hick's Law (max 1 primary CTA), and Doherty Threshold (400ms feedback) with specific, countable limits.

Load: rules/interaction-cognitive-load-thresholds.md

Form UX

Fitts's Law touch targets (44px mobile), top-aligned labels, Poka-Yoke error prevention with blur-only validation, and smart defaults.

Load: rules/interaction-form-ux.md

Persuasion Ethics

13 dark pattern red flags to detect and reject, the Hook Model ethical test (aware, reversible, user-benefits), and EU DSA Art. 25 compliance.

Load: rules/interaction-persuasion-ethics.md

Key Principles

  1. Keyboard parity — Every mouse interaction MUST have a keyboard equivalent. No drag-only, no hover-only.
  2. Skeleton over spinner — Use content-shaped placeholders for data loading; reserve spinners for indeterminate actions.
  3. Native HTML first — Prefer <dialog>, <details>, role="feed" over custom implementations.
  4. Progressive enhancement — Features should work without JS where possible, then enhance with interaction.
  5. Announce state changes — Use aria-live regions to announce dynamic content changes to screen readers.
  6. Respect scroll position — Back navigation must restore scroll position; infinite scroll must not lose user's place.

Anti-Patterns (FORBIDDEN)

  • Spinner for content loading — Spinners give no spatial hint. Use skeletons matching the content shape.
  • Infinite scroll without Load More — Screen readers and keyboard users cannot reach footer content. Always provide a button fallback.
  • Modal for browsable content — Modals trap focus and block interaction. Use drawers or inline expansion for browsing.
  • Drag-only reorder — Excludes keyboard and assistive tech users. Always provide arrow key + Enter alternatives.
  • Toast without ARIA role — Toasts are invisible to screen readers. Use role="status" for success, role="alert" for errors.
  • Auto-dismiss error toasts — Users need time to read errors. Never auto-dismiss error notifications.

Detailed Documentation

ResourceDescription
references/loading-states-decision-tree.mdDecision tree for skeleton vs spinner vs progress bar
references/interaction-pattern-catalog.mdCatalog of 15+ interaction patterns with when-to-use guidance
references/keyboard-interaction-matrix.mdKeyboard shortcuts matrix for all interactive patterns (WAI-ARIA APG)

Related Skills

  • ork:ui-components — shadcn/ui component patterns and CVA variants
  • ork:animation-motion-design — Motion library and View Transitions API
  • ork:accessibility — WCAG compliance, ARIA patterns, screen reader support
  • ork:responsive-patterns — Responsive layout and container query patterns
  • ork:performance — Core Web Vitals and runtime performance optimization

Comments

Markdown supported