Component structure (container vs presentational as needed)
Explicit handling for loading/empty/error states
Example usage and acceptance criteria
Rules
Components MUST have typed props (no implicit any).
Components SHOULD be small and composable.
Components MUST render explicit loading/empty/error states when dependent on async data.
Components SHOULD avoid hidden side effects; prefer hooks.
Steps
Define the component contract (props, callbacks, UI states).
Decide whether it is:
presentational (props in, UI out)
container (fetching/orchestration + composition)
Implement rendering logic:
default state
loading/empty/error
Implement interactions:
event handlers
accessibility considerations
Add a minimal verification:
renders
primary interaction works
error state renders
Verification
Component renders with valid props
Component handles loading state (when applicable)
Component handles empty state (when applicable)
Component handles error state (when applicable)
Primary interaction triggers expected callback
Component is accessible (keyboard navigation, focus visible)
Boundaries
MUST NOT use implicit any for props
MUST NOT hide side effects in render (use hooks)
MUST NOT skip loading/empty/error states for async-dependent components
SHOULD NOT create large components (decompose into smaller units)
SHOULD NOT mix container and presentational concerns without clear boundaries
SHOULD NOT ignore accessibility (aria labels, focus management)
Included assets
Templates: ./templates/ includes component scaffolds (presentational, container, list, modal).
Examples: ./examples/ includes a complete "profile-style" component example.
1---2name: build-react-components3description: Build React Components4---56# Build React Components78## Purpose9Provide patterns for building reusable, testable React components with clear responsibilities and predictable behavior.1011## When to use12Use this skill when you are:13- Creating new components (pages, feature components, shared UI)14- Refactoring large components into smaller units15- Implementing modals/dialogs and forms16- Building lists with filtering, pagination, and empty states1718## Inputs19- Component responsibilities and expected interactions20- Data dependencies (what inputs come via props vs fetched)21- Styling approach (UI kit, CSS modules, styled components, etc.)2223## Outputs24- Typed component props and public API25- Component structure (container vs presentational as needed)26- Explicit handling for loading/empty/error states27- Example usage and acceptance criteria2829## Rules30- Components MUST have typed props (no implicit `any`).31- Components SHOULD be small and composable.32- Components MUST render explicit loading/empty/error states when dependent on async data.33- Components SHOULD avoid hidden side effects; prefer hooks.3435## Steps361. Define the component contract (props, callbacks, UI states).372. Decide whether it is:38 - presentational (props in, UI out)39 - container (fetching/orchestration + composition)403. Implement rendering logic:41 - default state42 - loading/empty/error434. Implement interactions:44 - event handlers45 - accessibility considerations465. Add a minimal verification:47 - renders48 - primary interaction works49 - error state renders5051## Verification5253- [ ] Component renders with valid props54- [ ] Component handles loading state (when applicable)55- [ ] Component handles empty state (when applicable)56- [ ] Component handles error state (when applicable)57- [ ] Primary interaction triggers expected callback58- [ ] Component is accessible (keyboard navigation, focus visible)5960## Boundaries6162- MUST NOT use implicit `any` for props63- MUST NOT hide side effects in render (use hooks)64- MUST NOT skip loading/empty/error states for async-dependent components65- SHOULD NOT create large components (decompose into smaller units)66- SHOULD NOT mix container and presentational concerns without clear boundaries67- SHOULD NOT ignore accessibility (aria labels, focus management)6869## Included assets70- Templates: `./templates/` includes component scaffolds (presentational, container, list, modal).71- Examples: `./examples/` includes a complete "profile-style" component example.
Run npx skillmds@latest add willyu1007/build-react-components in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Build React Components It is listed under Web & Frontend on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
willyu1007 (@willyu1007) published this skill. Their other Agent Skills are listed on their SkillMD profile.