web-component-design

Implements reusable React, Vue, and Svelte components with composition patterns and CSS-in-JS styling.

Updated May 20, 2026
One-click install
npx skills add https://github.com/TechCorp25/kingdom --skill web-component-design-techcorp25
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: web-component-design
Source: https://github.com/TechCorp25/kingdom/tree/main/.claude/skills/ui-design/skills/web-component-design
Command: npx skills add https://github.com/TechCorp25/kingdom --skill web-component-design-techcorp25

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building consistent, accessible, and reusable UI components across React, Vue, and Svelte requires deep knowledge of composition patterns, styling trade-offs, and ARIA requirements that are easy to get wrong. ## Core Features & Use Cases - Composition Patterns: Implement compound components, render props, slots, polymorphic components, and controlled/uncontrolled patterns with typed APIs. - CSS-in-JS Guidance: Compare and apply Tailwind with CVA, CSS Modules, styled-components, Emotion, and Vanilla Extract based on runtime and bundle constraints. - Accessibility Implementations: Build ARIA-compliant modals, dropdown menus, comboboxes, and form validation with focus trapping and live regions. - Use Case: When designing a component library, generate a forwardRef Button with variant props via class-variance-authority, then add an accessible Tabs compound component with keyboard navigation. ## Quick Start Ask the assistant to create an accessible React dropdown menu component with keyboard navigation and Tailwind styling.

Frequently Asked Questions about web-component-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a compound component in React?▼

Create a parent component that holds shared state in a React Context, then attach child components as static properties like Tabs.List and Tabs.Panel. Children consume the context via a custom hook that throws if used outside the parent.

Tailwind vs styled-components vs Vanilla Extract for component libraries?▼

Tailwind with class-variance-authority suits design systems needing utility-based variants with zero runtime. styled-components and Emotion offer full dynamic styling at runtime cost. Vanilla Extract provides type-safe, zero-runtime CSS for performance-critical apps.

How do I make a React modal accessible?▼

Use role="dialog" with aria-modal="true", trap focus inside the modal, close on Escape, and restore focus to the triggering element on close. Render via createPortal and label the dialog with aria-labelledby pointing to its title.

Should my component be controlled or uncontrolled?▼

Support both when possible: check if the value prop is undefined to detect uncontrolled mode, then manage internal state while still calling onChange. This gives consumers flexibility for simple forms or fully controlled state management.

Why do my React components re-render too often?▼

Re-render cascades usually come from unstable prop references or missing memoization. Profile with React DevTools, then apply React.memo, useMemo, and useCallback to expensive subtrees, and avoid creating new objects inline in JSX.