| name | react-component |
| description | Create React components following Atomic Design and project patterns. Use when asked to create a new component, build UI, or implement a feature with React. |
React Component Creation
When to Use
- Creating new components
- Building UI features
- Implementing designs
- Adding new pages or views
Process
Determine Component Level (Atomic Design)
- Atom: Basic building blocks (Button, Input, Label)
- Molecule: Simple combinations (FormField, SearchBar)
- Organism: Complex UI sections (Header, Card, Modal)
Create Directory Structure
src/components/{level}/{component-name}/ ├── index.tsx # Component implementation ├── index.test.tsx # Unit tests └── index.stories.tsx # Storybook storiesImplement Component following template
Add Tests using Testing Library
Create Storybook Story for documentation
File Location
| Level | Path |
|---|---|
| Atoms | src/components/atoms/{name}/ |
| Molecules | src/components/molecules/{name}/ |
| Organisms | src/components/organisms/{name}/ |
Template
See template.tsx for the base component structure.
Checklist
- TypeScript props interface defined
- JSDoc comments added
- Named export (not default)
- Default values for optional props
- Props sorted alphabetically
- Accessible (semantic HTML, ARIA if needed)
- Unit tests written
- Storybook story created
Example Usage
When asked: "Create a Card component"
- Determine it's an Atom or Molecule based on complexity
- Create
src/components/atoms/card/directory - Use the template structure
- Add props interface with children, variant, etc.
- Implement with TailwindCSS
- Write tests
- Create Storybook story