Convert Figma designs into production-ready UI components for React, Vue, Svelte, Angular, and Solid.
nCompose takes a Figma URL and generates framework-native code with proper CSS, accessibility, icons, and variant support. It uses LLM intelligence to interpret design intent and the Mitosis compiler to target multiple frameworks from a single intermediate representation.
https://github.com/user-attachments/assets/a9d9b98c-9bec-4cdb-96c6-6eec151be67a
cn() utility, and CSS variablesgit clone https://github.com/nesterlabs-ai/nCompose.git
cd nCompose
npm install
Web UI (recommended):
npm run web
Open http://localhost:3000 — paste a Figma URL, select frameworks, and click Convert.
CLI:
npm run dev -- convert "https://www.figma.com/design/XXXX/...?node-id=123-456" \
-f react,vue,svelte \
--llm deepseek \
-o ./output
ncompose convert <url> [options]
Arguments:
url Figma design URL with node-id parameter
Options:
-f, --frameworks <list> Comma-separated frameworks: react,vue,svelte,angular,solid
(default: react)
--llm <provider> LLM provider: deepseek, claude
(default: deepseek)
-o, --output <dir> Output directory (default: ./output)
--template Wire into starter app with Tailwind
--preview Open preview after conversion
The Web UI is not a ncompose subcommand — start it from the repo with npm run web (see Quick Start). Port defaults to 3000 (override with the PORT environment variable).
After npm run build, you can also run npx ncompose or npx figma-to-code (backwards-compatible alias).
The web interface provides a full-featured development experience:
| Provider | Flag | Model | Env Variable |
|---|---|---|---|
| DeepSeek | --llm deepseek (default) |
deepseek-chat | DEEPSEEK_API_KEY |
| Anthropic | --llm claude |
claude-sonnet-4-20250514 | ANTHROPIC_API_KEY |
We recommend using DeepSeek for conversions — it offers the best balance of speed, cost, and output quality.
| Input Type | Path | Description |
|---|---|---|
| Component Set | PATH A | Parses variant axes, generates deterministic BEM CSS from Figma tokens, scans all variants for icons |
| Single node | PATH B | Serializes design to CSS-ready YAML, generates class-based component with extracted CSS |
| Multi-section page | PATH C | Detects sections, processes each in parallel, stitches into single page component |
| Chart/graph | Chart | Detects chart patterns, extracts data via LLM, generates Recharts component |
Every generated component passes through up to 6 validators:
Failures are fed back to the LLM for automatic correction (up to 3 retries).
output/
└── ComponentName-{sessionId}/
├── ComponentName.lite.tsx # Mitosis source
├── ComponentName.jsx # React
├── ComponentName.vue # Vue
├── ComponentName.svelte # Svelte
├── ComponentName.ts # Angular
├── ComponentName.tsx # Solid
├── ComponentName.meta.json # Variant metadata
├── ComponentName.fidelity.json # Validation report
├── assets/
│ └── *.svg # Exported icons
└── app/ # Wired starter app (--template)
Contributions are welcome. See CONTRIBUTING.md for development setup, branch naming, commit conventions, and PR process.
MIT — Nester Labs