/sumi:component-patterns-codefrom Sumi
Generates production UI component code in React/TypeScript, SwiftUI, and CSS with full state matrices, ARIA attributes, keyboard handling, and design token consumption. Use when building or reviewing buttons, modals, forms, inputs, tables, or any component needing all states covered.
Ships in Sumi. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
"A component is not a visual artifact. It is a state machine with a visual output." Every button, input, modal, and card exists in a matrix of states that must be designed, implemented, and tested. Developers and designers who treat components as static visual elements inevitably ship incomplete interfaces that break under real-world conditions — when the network is slow, when the user tabs instead of clicks, when the content is unexpectedly long, when the screen is 320px wide.
Production-quality component engineering demands three disciplines simultaneously: visual fidelity (the component looks correct across every state), behavioral completeness (the component responds correctly to every interaction), and semantic correctness (the component communicates its purpose and state to all users, including those using assistive technology).
Every component exists in far more states than the typical design file represents. The State Matrix is a systematic enumeration of every possible visual and behavioral state a component can occupy. Before writing a single line of code, enumerate the full matrix.
These states apply to virtually every interactive component:
States combine. A text input can be simultaneously focused and in an error state. A button can be loading and disabled. A table row can be selected and hovered. Your component API must handle compound states gracefully without combinatorial explosion. The recommended pattern is to model each state dimension independently:
This dimensional model yields a manageable API surface rather than an unwieldy union of every possible combination.
Before any component ships:
Organizing components into functional categories creates a shared vocabulary for the team and ensures coverage. The taxonomy below covers the foundational set that virtually every product needs.
Components that trigger operations. The user clicks, taps, or activates them to cause something to happen.
Components that accept user data.
Components that communicate status, results, or system state to the user.
Components that move the user between views, sections, or pages.
Components that present or contain information.
Components optimized for displaying structured datasets.
Every component must consume design tokens rather than hardcoded values. Tokens are the contract between design and code. They ensure that when the design system changes a color, spacing value, or font, every component updates automatically.
--color-primary, --color-surface, --color-on-surface, --color-error, --color-border--space-xs, --space-sm, --space-md, --space-lg, --space-xl--font-family-body, --font-size-sm, --line-height-normal, --font-weight-medium--radius-sm, --radius-md, --radius-lg, --radius-full--shadow-sm, --shadow-md, --shadow-lg--duration-fast, --duration-normal, --easing-standard, --easing-decelerate--size-touch-target (44px minimum), --size-icon-sm, --size-icon-md--button-bg: var(--color-primary).--button-bg-hover: var(--color-primary-hover).Accessibility is not an enhancement. It is a baseline requirement. Components built with accessibility from the start are cheaper to maintain, more robust, and usable by everyone.
tabindex or DOM order reflects the intended sequence.<button>, <input>, <dialog>, <nav>). ARIA is a supplement, not a replacement.aria-expanded, aria-selected, aria-checked, aria-busy, aria-invalid, aria-disabled.aria-live="polite" or aria-live="assertive") announce dynamic content changes (toast notifications, form validation messages, loading completions).aria-label. Every image requires alt text or aria-hidden="true" if decorative.role="status" or aria-live="polite" so screen readers announce them without interrupting the current task.aria-describedby.aria-busy="true" on the loading region.Media queries respond to the viewport. Container queries respond to the component's container. Since components are reused in different layout contexts (sidebar, main content, modal), container queries produce correct results where media queries fail.
.card-container {
container-type: inline-size;
container-name: card;
}
@container card (min-width: 400px) {
.card { flex-direction: row; }
}
@container card (max-width: 399px) {
.card { flex-direction: column; }
}
Use clamp() for typography and spacing that scales smoothly between breakpoints without abrupt jumps:
font-size: clamp(1rem, 0.5rem + 1.5vw, 1.5rem);
padding: clamp(0.75rem, 2vw, 2rem);
Per WCAG 2.5.8 (Target Size), interactive elements must be at least 24x24 CSS pixels, with a recommendation of 44x44 pixels. Apple HIG specifies 44pt minimum. Material Design specifies 48dp. Always err on the side of larger targets on touch devices.
This is directly informed by Fitts's Law (see cognitive-psychology-ux): the time to reach a target is a function of distance and target size. Smaller targets increase error rates and frustration, especially under mobile conditions (one-handed use, walking, glare).
For React — the cn() utility, then Button, TextInput, Select, Dialog,
Toast, Card, Badge, Avatar and the rest as complete CVA + Tailwind + Radix
implementations with every state and full ARIA: read
references/react-component-cookbook.md.
For SwiftUI — the EnvironmentKey-based theme system, then PrimaryButton,
ValidatedTextField, AdaptiveSheet, SwipeableListRow, AdaptiveNavigationStack,
DynamicForm, BadgedTabView and CachedAsyncImage: read
references/swiftui-component-cookbook.md.
For modern CSS — container queries, :has(), subgrid, @layer, and the
patterns that replace what used to need JavaScript: read
references/css-modern-patterns.md.
cognitive-psychology-ux covers Fitts's Law (touch target sizing), Hick's Law (reducing choice overload in selects and menus), Miller's Law (chunking in data tables and forms), and the gestalt principles that inform component grouping and layout.accessibility-inclusive-design provides the full WCAG 2.2 checklist, assistive technology testing procedures, and inclusive design patterns that component code must satisfy.ui-visual-design-system details the token naming conventions, scale generation, and semantic mapping that components consume.interaction-motion-design covers easing curves, duration scales, reduced-motion handling, and spring physics that component transitions use.figma-design-tool-workflows describes how component designs in Figma translate to code, including auto-layout to flexbox mapping, variant properties to component props, and design token export.design-systems-architecture explains how components are documented, versioned, tested, and distributed across teams.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
45 skills in this plugin
/accessibility-inclusive-designWCAG 2.2 compliance, ARIA authoring patterns, screen reader and keyboard navigation, color contrast, and cognitive/neurodiversity accommodations. Use when auditing accessibility, fixing a11y violations, choosing ARIA roles, checking contrast ratios, or designing for ADHD, dyslexia, autism, or motor impairment./agentic-ai-generative-uxDesign patterns for agentic AI: multi-agent orchestration UX, generative UI, RAG interfaces, LLM hallucination guardrails, confidence indicators, and trust calibration. Use when designing AI copilots or autonomous agents, adding verification affordances, or auditing an AI feature for safety, control, and consent./ai-design-generationProduce visual assets from AI image and UI models through MCP — Stitch screens, Fal.ai (Imagen, FLUX, Veo), Recraft V3 vectors, GPT-Image and Figma file access — with prompt patterns and quality scoring. Use when rendering mockups, icons, illustrations or video. Not for interface copy; not for agent UX./ai-spatial-voice-uxAI-native interface patterns, conversational and voice UX, spatial computing (AR/VR/MR), and multimodal interaction. Use when designing a chatbot or assistant, a voice-first flow, headset or mixed-reality UI, or when combining speech, gaze, and gesture input./ambient-calm-zero-uiCalm technology principles, zero-UI and screenless patterns, ambient displays, proactive intelligence, and peripheral attention design. Use when designing smart home, automotive, wearable, or background-intelligence experiences, or reducing notification and attention load./animation-recipe-library200+ copy-paste animation recipes in CSS, Framer Motion, and GSAP: entrances, micro-interactions, page transitions, scroll-driven effects, spring physics, and cursor and text effects, each with timing, easing, and a reduced-motion fallback. Use when you need working motion code rather than motion principles.npx claudepluginhub phazurlabs/sumi --plugin sumiOther plugins' skills for the same job