component-design

Design React/Vue components following atomic design and composition patterns. Use when creating UI components.

⭐21stars🔀15forks📁View on GitHub🕐Updated Jan 7, 2026⬇️1downloads

When & Why to Use This Skill

This Claude skill empowers developers to architect scalable and maintainable front-end systems using React and Vue. By implementing Atomic Design principles and advanced composition patterns, it facilitates the creation of a structured component hierarchy—from basic atoms to complex organisms—ensuring high reusability, consistent state management, and clean prop interfaces for professional-grade UI development.

Use Cases

  • Scenario 1: Building a comprehensive design system from scratch using Atomic Design methodology to ensure visual and functional consistency across large-scale applications.
  • Scenario 2: Refactoring monolithic or 'spaghetti' code into modular, reusable patterns such as Compound Components, Render Props, or Custom Hooks to improve code maintainability.
  • Scenario 3: Designing robust and type-safe prop interfaces for complex UI elements like data tables, modals, and multi-step forms to reduce runtime errors.
  • Scenario 4: Implementing standardized state management strategies by following a structured decision tree to choose between local state, context, or global stores.
namecomponent-design
descriptionDesign React/Vue components following atomic design and composition

Component Design Skill

Purpose

Create consistent, reusable UI components.

Atomic Design

Reference: patterns/atomic-design.md

Hierarchy

  1. Atoms: Basic elements (Button, Input, Label)
  2. Molecules: Simple groups (FormField, SearchBox)
  3. Organisms: Complex sections (Header, Form, Card)
  4. Templates: Page layouts
  5. Pages: Specific instances

Component Patterns

Reference: patterns/composition.md

Compound Components

<Select>
  <Select.Trigger />
  <Select.Content>
    <Select.Item value="1">Option 1</Select.Item>
  </Select.Content>
</Select>

Render Props

<DataFetcher url="/api/users">
  {({ data, loading }) => (
    loading ? <Spinner /> : <UserList users={data} />
  )}
</DataFetcher>

Custom Hooks

function useUser(id: string) {
  const [user, setUser] = useState(null);
  const [loading, setLoading] = useState(true);
  // ...
  return { user, loading, error };
}

Props Interface

interface ButtonProps {
  /** Visual variant of the button */
  variant?: 'primary' | 'secondary' | 'ghost';
  /** Size of the button */
  size?: 'sm' | 'md' | 'lg';
  /** Whether button is disabled */
  disabled?: boolean;
  /** Click handler */
  onClick?: () => void;
  /** Button content */
  children: React.ReactNode;
}

Component Template

Use: templates/component-template.tsx

State Management

Reference: patterns/state-management.md

Decision Tree

  1. UI-only state → useState
  2. Complex local state → useReducer
  3. Shared between siblings → Lift to parent
  4. Shared across app → Context or global store
  5. Server state → React Query/SWR