web-component-design
Web Component Design
Build reusable, maintainable UI components using modern frameworks with clean composition patterns and styling approaches.
When to Use This Skill
- Designing reusable component libraries or design systems
- Implementing complex composition patterns (Compound Comps, Slots, Render Props)
- Choosing CSS-in-JS solutions (Tailwind, Styled Components)
- Building accessible, responsive UI
- Refactoring legacy components
Workflow
- Define API: Design the Props interface (semantic naming, defaults).
- Choose Strategy: Compound component vs Monolithic configuration?
- Implement: Build structure, styles (CVA), and behavior.
- Refine: Add Accessibility (ARIA) and Forward Refs.
Instructions
1. Component Composition Patterns
Compound Components (React): Allow flexible layouts by breaking components into parts sharing state internally.
<Select>
<Select.Trigger>Choose</Select.Trigger>
<Select.Options>...</Select.Options>
</Select>
Slots (Vue/Svelte): Named content injection points for flexible templates.
<Card>
<template #header>Title</template>
<template #content>Body</template>
</Card>
2. Styling Approaches
- Tailwind + CVA: Best for modern Design Systems. Type-safe variants.
- CSS Modules: Best for isolating styles in legacy apps.
- Styled-Components: Good for dynamic JS-driven styles.
3. Component API Design (Props)
- Boolean Flags:
isLoading,isDisabled(is[Adjective]). - Variants:
variant="primary",size="lg". - Composition: Always accept
childrenorslots. - Overrides: Always accept
classNameorstyleto allow user customization.
4. Framework Examples
- React: CVA Button Example
- React Compound: Accordion Pattern
- Svelte: Snippets & Runes for reactive props.
Resources
More from mileycy516-stack/skills
trading-psychology-coach
High-performance mental coach for traders. implementation of "Mental Hand History", A-Game/C-Game mapping, and probabilistic thinking protocols. Use PROACTIVELY to analyze behavior, reduce tilt, and optimize the Human OS.
52frontend-developer
Build React components, implement responsive layouts, and handle client-side state management. Masters React 19, Next.js 15, and modern frontend architecture. Optimizes performance and ensures accessibility.
9vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
6context-manager
Elite AI context engineering specialist mastering dynamic context management, vector databases, knowledge graphs, and intelligent memory systems. Orchestrates context across multi-agent workflows, enterprise AI systems, and long-running projects.
4design-system-architect
Master design system architecture to create consistent, maintainable, and scalable UI foundations. Establish design tokens, theming hierarchies, type scales, and brand identity codes.
4backend-architect
Expert backend architect specializing in scalable API design, microservices architecture, and distributed systems. Masters REST/GraphQL/gRPC APIs, event-driven architectures, service mesh patterns, and modern backend frameworks.
4