Designs React/Vue component APIs — props, composition, event handling, accessibility.
---
name: Component API Design
description: Design clean, composable React/Vue component APIs with accessibility built in.
---
# Component API Design
Use this skill to design the public API of a UI component before writing
implementation. A good API is learnable, hard to misuse, and composable.
## Principles
1. **Make the common case effortless, the complex case possible.**
2. **Prefer composition over configuration** — slots beat boolean explosions.
3. **The prop name is documentation** — it should read aloud as English.
4. **Accessibility is not a prop** — it is the default behavior.
## Step 1: Name the responsibilities
List every job the component does. If it does more than one thing that could vary
independently, split it. A `Menu` that also manages a button is two components:
`Menu` and `MenuTrigger`.
## Step 2: Choose the composition model
… install to load the full skillSign in to rate and review this skill.
No reviews yet. Be the first to review this skill.