Document a Component
Workflow for writing component documentation with examples
CLAUDE.md
When documenting a component:
- Start with a one-line description of what the component does and when to use it.
- List all props with their types, default values, and descriptions.
- Provide a basic usage example showing the most common configuration.
- Provide examples for common variants: different sizes, states, or configurations.
- Document any events or callbacks the component emits.
- Note accessibility features: keyboard interactions, ARIA attributes, screen reader behavior.
- List do’s and don’ts: common patterns to follow and anti-patterns to avoid.
Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.