Convert Figma designs to production-ready React/Vue components. Supports CSS Modules, Tailwind, and plain CSS.
📖 New here? Check the Quick Start Guide for step-by-step setup.
English | 中文
For local development and CI/CD integration.
npx figma-to-code-agent --token YOUR_TOKEN --file FILE_KEY --framework react --output ./outputIntegrate with Claude Desktop or Kiro IDE, generate code through AI conversations.
Use as a Skill in Kiro IDE for seamless design-to-code workflow.
| Original Design | React | Vue |
|---|---|---|
![]() |
![]() |
![]() |
| Original Design | React | Vue |
|---|---|---|
![]() |
![]() |
![]() |
| Original Design | React | Vue |
|---|---|---|
![]() |
![]() |
![]() |
| Original Design | React | Vue |
|---|---|---|
![]() |
![]() |
![]() |
- 🎨 Extract designs from Figma API with caching and rate-limit handling
- ⚛️ Generate React (.jsx/.tsx) and Vue (.vue) components
- 🎭 Support CSS Modules, Tailwind CSS, and plain CSS
- 📐 Responsive layout with viewport adaptation
- 🖼️ 2x resolution image export, auto-detect vector icons
- 🎯 Design token extraction (CSS variables, SCSS, JSON, JS)
- ♿ Accessibility enhancements (ARIA roles, alt text)
- ⚡ Performance optimization (lazy loading, code splitting, style deduplication)
- 🤖 Optional AI enhancements (semantic naming, component splitting, code optimization)
- 🔌 MCP server (integrate with Claude Desktop / Kiro IDE)
- 🎯 Kiro Skill (use as a skill in Kiro IDE)
- 📊 Design consistency checker
- 🎮 Interactive prototype generator
npm install -g figma-to-code-agentnpm install figma-to-code-agentnpx figma-to-code-agent --token YOUR_TOKEN --file FILE_KEY --output ./output# Generate React component
npx figma-to-code-agent \
--token YOUR_FIGMA_TOKEN \
--file FILE_KEY \
--node NODE_ID \
--framework react \
--output ./output
# Generate and preview
npx figma-to-code-agent \
--token YOUR_FIGMA_TOKEN \
--file FILE_KEY \
--framework react \
--output ./output \
--previewFor more usage options, see the Quick Start Guide.
- Extract: Fetch design data via Figma API (with caching)
- Parse: Parse design tree into intermediate AST
- Transform: Apply transformation pipeline (flatten, extract components, optimize, semantic naming)
- Generate: Generate framework-specific component code
- Optimize: Style deduplication, responsive handling, accessibility enhancements
For detailed architecture, see Architecture Documentation.
| Option | Description | Default |
|---|---|---|
--token <token> |
Figma API token | — |
--file <key> |
Figma file key | — |
--node <id> |
Target node ID | root |
--framework |
react or vue |
react |
--style |
css-modules, tailwind, or css |
css-modules |
--typescript |
Enable TypeScript | false |
--output <dir> |
Output directory | ./output |
--preview |
Preview in browser after generation | — |
--mcp |
Start MCP server mode | — |
| Option | Description |
|---|---|
--llm-provider |
bedrock, openai, or anthropic |
--llm-model |
Model name |
--ai-naming |
AI-powered semantic naming |
--ai-optimization |
AI-powered code optimization |
For complete options, see CLI Usage Guide.
- 📖 Quick Start - Get started in 5 minutes
- 🖥️ CLI Guide - Complete CLI reference
- 🔌 MCP Guide - Integrate with Claude/Kiro
- 🎯 Kiro Skill Guide - Use in Kiro IDE
- 🏗️ Architecture - System architecture
- 🎨 Examples - Real conversion examples
git clone https://github.com/lewiscutey/figma-to-code-agent.git
cd figma-to-code-agent
npm install
npm run build # Compile TypeScript
npm test # Run tests (222 tests)
npm run lint # Lint code- Node.js 18+
- Figma access token (Get token)
MIT License - See LICENSE file for details











