web-component-design

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

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill web-component-design-sanketadlak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: web-component-design
Source: https://github.com/SanketAdlak/PDMProjectDesign/tree/main/.agents/skills/web-component-design
Command: npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill web-component-design-sanketadlak

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 Patterns: Build modals, dropdown menus, comboboxes, and forms with focus trapping, ARIA attributes, keyboard navigation, and live regions. - Use Case: When designing a design system Button component, generate a forwardRef-based implementation with variant/size props via class-variance-authority and Tailwind classes. ## Quick Start Ask the assistant to create an accessible Tabs component using compound components in React 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 parent component that holds shared state in a React Context, then attach child components as static properties like Tabs.List and Tabs.Tab. 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 CVA suits design systems needing utility-based variants with zero runtime. styled-components offers full dynamic styling at runtime cost. Vanilla Extract provides type-safe, zero-runtime CSS for performance-critical applications.

How do I make a modal dialog accessible in React?

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

Should a component be controlled or uncontrolled?

Support both when possible: accept an optional value prop for controlled mode and defaultValue for uncontrolled mode. Detect controlled mode by checking whether value is undefined, and always call onChange with new values.

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.