web-component-design

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

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/truongnat/Restly --skill web-component-design-truongnat
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: web-component-design
Source: https://github.com/truongnat/Restly/tree/main/.agents/skills/web-component-design
Command: npx skills add https://github.com/truongnat/Restly --skill web-component-design-truongnat

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. - Styling Guidance: Compare and apply Tailwind CSS 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, form validation, skip links, and live regions with focus management. - Use Case: When creating a design system Button component, generate a forwardRef implementation with CVA variants, loading states, and proper disabled handling in one pass. ## Quick Start Ask the assistant to create an accessible Tabs component using the compound component pattern with 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 context in the parent component that holds shared state, then attach child components as static properties that consume that context via a custom hook. The included Tabs example shows the full pattern with role, aria-selected, and keyboard support.

Tailwind vs styled-components vs Vanilla Extract for a design system?▼

Tailwind with CVA suits rapid iteration and utility-based design tokens, styled-components offers full dynamic styling at runtime cost, and Vanilla Extract provides zero-runtime type-safe styles. Choose based on bundle size constraints and dynamic styling needs.

How do I make a modal dialog accessible in React?▼

Use role="dialog" with aria-modal="true", trap focus inside the container, 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 a component be controlled or uncontrolled?▼

Support both when possible: accept an optional value prop for controlled mode and fall back to internal state initialized by defaultValue for uncontrolled mode. Detect controlled mode by checking whether value is undefined.

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

Re-render cascades usually come from unstable context values, inline object props, or missing memoization. Profile with React DevTools, then apply React.memo, useMemo, and useCallback to stabilize references passed to children.