
Component Creation
- 1 installs
- 27 repo stars
- Updated April 25, 2026
- girijashankarj/cursor-handbook
Step-by-step workflow for creating accessible, tested UI components in React or Vue, including component directory structure and unit tests.
About
Guides creation of a new UI component with defined props, directory structure, styling, and unit tests. A developer uses it to create an accessible, tested UI component.
- Scaffolds a component directory with implementation and test files
- Defines props, state, and parent/child relationships before coding
Component Creation by the numbers
- 1 all-time installs (skills.sh)
- Ranked #1,914 of 2,245 Frontend Development skills by installs in the Skillselion catalog
- Data as of Jul 22, 2026 (Skillselion catalog sync)
npx skills add https://github.com/girijashankarj/cursor-handbook --skill component-creationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 27 |
| Last updated | April 25, 2026 |
| Repository | girijashankarj/cursor-handbook ↗ |
What it does
Step-by-step workflow for creating accessible, tested UI components in React or Vue, including component directory structure and unit tests.
Files
Skill: Create UI Component
Trigger
When the user asks to create a new UI component.
Prerequisites
- [ ] Project uses React (or Vue; adjust steps)
- [ ]
src/components/or equivalent exists - [ ] Testing framework configured (Jest, Vitest, etc.)
- [ ] Styling approach known (Tailwind, CSS Modules, etc.)
Steps
Step 1: Define Component
- [ ] Name the component (PascalCase)
- [ ] Define its purpose and responsibilities
- [ ] Identify parent and child components
- [ ] List props and their types
- [ ] Identify state requirements
Step 2: Create Component Directory
src/components/{category}/{ComponentName}/
├── {ComponentName}.tsx # Component implementation
├── {ComponentName}.test.tsx # Unit tests
├── {ComponentName}.stories.tsx # Storybook story (optional)
└── index.ts # Public exportStep 3: Define Props Interface
- [ ] Create TypeScript interface for props
- [ ] Add JSDoc documentation for complex props
- [ ] Set default values where appropriate
- [ ] Mark optional props with
?
Step 4: Implement Component
- [ ] Use functional component with hooks
- [ ] Destructure props in function signature
- [ ] Implement rendering logic
- [ ] Add error boundary if needed
- [ ] Handle loading, error, and empty states
Step 5: Add Accessibility
- [ ] Semantic HTML elements used
- [ ] ARIA attributes where needed
- [ ] Keyboard navigation works
- [ ] Focus management for modals/popups
- [ ] Color contrast meets WCAG 2.1 AA
Step 6: Add Styling
- [ ] Follow project styling approach
- [ ] Responsive across breakpoints
- [ ] Dark mode support
- [ ] Design token usage (no magic numbers)
- [ ] No inline styles (except dynamic values)
Step 7: Write Tests
- [ ] Renders correctly with default props
- [ ] Renders correctly with all prop combinations
- [ ] User interactions work (click, type, etc.)
- [ ] Accessibility tests pass
- [ ] Error states handled
Step 8: Create Export
- [ ] Export component from index.ts
- [ ] Export props interface
Completion Checklist
- [ ] Component renders with default props
- [ ] Props interface exported
- [ ] Tests pass
- [ ] Accessibility: keyboard nav, ARIA, contrast
- [ ] No lint/type errors
If Step Fails
- Step 2 (directory): Match existing structure in
src/components/(ui/, features/, layout/) - Step 5 (a11y): Use
aria-labelon icon buttons;roleonly when semantic HTML insufficient - Step 7 (tests): Run single file:
npm test -- ComponentName.test.tsx. Fix type errors first with{{CONFIG.testing.typeCheckCommand}}
Example
Step 1: OrderSummary — displays order total and item count. Props: items, taxRate. Step 4: Functional component, useMemo for total calculation, loading/empty states.