Skip to content
Back to skills

React Component Design

ASecurity

Designs and reviews React components for clean state, correct effects, composition and complete loading, empty and error states, in TypeScript.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 15, 2026
ai-agentstypescriptreact

Works with

  • cli

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill react-component-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of React Component Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for React Component Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-react-component-design/badge)](https://www.skillsdirectory.com/skills/workspace-templates-react-component-design)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: react-component-design
description: Designs and reviews React components for clean state, correct effects, composition and complete loading, empty and error states, in TypeScript.
---

# React component design

Write function components in TypeScript. Keep them small and boring.

## Steps

1. Define the job in one sentence. If it needs "and", split it into two components.
2. Type the props: required props first, no `any`, a discriminated union instead of several booleans (`status: 'idle' | 'loading' | 'error'`). Accept `children` or a slot prop instead of adding a prop per variation.
3. Place state at the lowest component that needs it. Do not store anything you can compute from props or other state; compute it during render (`useMemo` only after you measured).
4. Treat `useEffect` as a last resort. Never use it to transform data, reset state from props (use a `key`) or respond to a click (use the handler). Use it for subscriptions and syncing with outside systems, always with a cleanup and a complete dependency list. Fetch with the project's data library, not a bare effect.
5. Cover every data state: loading (skeleton or spinner), empty (a message and next action), error (readable text and retry), and success. Write them before the happy path.
6. Lists need stable `key` values from the data, never the index when order can change.
7. Prefer composition: pass components or render props instead of a config object that grows.
8. Make it accessible: native elements, labels, focus.

## Rules

- No prop drilling past two levels: use composition or context.
- Do not mutate props or state.

## Report

The component code, the states it handles, and anything you left to the caller.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.