Designs React/Vue component APIs – props, composition, event handling, accessibility.
Designs React/Vue component APIs - props, composition, event handling, accessibility.This is the skill's description: the text your AI reads to decide when the skill applies.
component-api-design/SKILL.md
---
name: Component API Design
description: Design clean, composable React/Vue component APIs with accessibility built in. Use when designing or reviewing a component's props, composition, events or accessibility, or when a component API has grown hard to use.
---
# 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
… load the full skill through Skill MeClick to play with sound.