Design System GuideDS Guide
Docs
Docs
18. Component API Design18.1 Prefer semantic props18.2 Avoid boolean explosion18.3 Composition over mega-components18.4 Controlled vs uncontrolled APIs18.5 Escape hatches
19. Patterns, Templates, and Product-Specific Components
18. Component API Design

18.3 Composition over mega-components

Component API Design · Section 18.3

Bad:

<Card
  title=""
  subtitle=""
  image=""
  footer=""
  button=""
  badge=""
  menu=""
/>

Better:

<Card>
  <CardHeader>
    ...
  </CardHeader>

  <CardContent>
    ...
  </CardContent>
</Card>

Composition scales better.

18.2 Avoid boolean explosion

Component API Design · Section 18.2

18.4 Controlled vs uncontrolled APIs

Component API Design · Section 18.4