# /react-components: Turn Stitch screens into modular, validated React code

Source: https://trendhub.net/skills/google-labs-code-stitch-skills/react-components
Skill folder: https://github.com/google-labs-code/stitch-skills/tree/main/plugins/stitch-build/skills/react-components
Pack: Stitch Skills (https://trendhub.net/skills/google-labs-code-stitch-skills)
Works with: Codex, Claude Code, Cursor, Any Agent Skills host (selective), OpenCode

react-components converts Stitch screens into a Vite and React app, or syncs existing components with newer designs. It runs in gated phases: download every screen with a bundled script and inspect its screenshot, extract Tailwind tokens into a style guide, then write components that follow strict architecture rules checked by an AST-based validator.

## When to use it

- A Stitch project is approved and you need it as a working React codebase.
- Designs changed in Stitch and your existing components need to match again.
- You want generated code split into components, hooks and data rather than one page file.

## How it works

1. **Fetch every screen**: The agent calls get_screen for each screen, downloads HTML and full-width screenshots with fetch-stitch.sh, asks before replacing local copies and views each screenshot.
2. **Extract tokens**: It pulls colours, fonts, spacing and radii from each file's tailwind.config into resources/style-guide.json for this project only.
3. **Apply architecture rules**: Reusable patterns become separate components, logic moves into hooks, content into mockData.ts, and every file gets a Readonly Props interface.
4. **Wire navigation**: Placeholder links become React Router links with active states, and the logo always links home.
5. **Validate with permission**: With your consent it runs the validator on each file, tsc --noEmit and the architecture checklist before starting a dev server.

## What it steers the agent away from

- Monolithic page files with hardcoded text and hex colours
- Reusing tokens from a previous project
- Starting dev servers or browser checks without asking

## What it can touch

Calls Stitch MCP tools, runs a bundled download script and npm install, writes React source, style-guide.json and .stitch/metadata.json, and runs validation and the dev server only with approval.

## Pairs well with

- `/react-native`
- `/react-vite-dashboard`
- `/generate-design`

## Questions

### Does it support dark mode?

Yes. It is told to add dark: variants to every colour class in every component.

### Why does it insist on its own download script?

According to the skill, an agent's built-in fetching often breaks on Google Cloud Storage download links, so the script deals with the redirects.
