28.7k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill wshobson/agents --skill web-component-design- SKILL.md7.6 KB
Overview
This skill teaches practical patterns for designing reusable UI components across React, Vue, and Svelte. It focuses on composition strategies, CSS-in-JS choices, accessible defaults, and consistent component APIs to build maintainable component libraries and design systems.
How this skill works
The skill explains composition patterns such as compound components, render props, and slots, and shows framework-specific implementations and code examples. It compares styling approaches (Tailwind, CSS Modules, styled-components, Emotion, Vanilla Extract) and shows API design principles and quick-start component examples to apply immediately.
When to use it
- Building a shared UI component library or design system
- Designing consistent, composable component APIs
- Implementing accessible, responsive UI components
- Refactoring legacy UI into modern patterns
- Choosing a CSS-in-JS approach for performance and scalability
Best practices
- Give each component a single responsibility and sensible defaults
- Use context or composables to avoid prop drilling for nested composition
- Prefer accessible-by-default patterns: ARIA, keyboard support, focus management
- Support both controlled and uncontrolled usage where it makes sense
- Expose style overrides via className/style and forward refs for DOM access
- Memoize heavy renders and add error boundaries around risky components
Example use cases
- Create a compound Select or Accordion using context to manage internal state
- Build a design system button with variants, sizes, loading state, and utility-driven styles
- Replace global CSS with CSS Modules or Vanilla Extract to avoid style conflicts in a large app
- Implement slots in Vue or Svelte for flexible card layouts with header/content/footer regions
- Provide a DataFetcher render-prop wrapper to centralize loading and error UX handling
FAQ
Zero-runtime solutions like Vanilla Extract minimize runtime cost and give strong performance; Tailwind is fast for developer velocity but can increase runtime if not purged properly.
When should I use compound components vs render props?
Use compound components when you want a declarative nested API that shares internal state; use render props when you need to hand rendering control to the parent or inject render-time data.