f2c – Figma to CodeConvert Figma designs to React / Vue 3 components with AI. No Figma plugin required — paste a link, get production-ready code. Available as a VSCode extension (this page) and a CLI for terminal users. One Pro license key activates both. Step 1: First-time SetupOpen VSCode Settings:
Search for "f2c" in the settings search bar. Fill in these fields: f2c.figmaToken (required)Your Figma Personal Access Token. To get it:
f2c.ai.provider (required)Choose your AI provider: openai / claude / ollama
f2c.ai.apiKey (required for openai / claude)Paste your OpenAI or Anthropic API key here. For Ollama (local), leave this blank. f2c.output.frameworkreact (default) or vue Determines the output file format: .tsx for React, .vue for Vue 3 SFC. f2c.output.css
f2c.output.typescripttrue (default) or false Step 2: Get a Figma URL
Important: the URL must contain ?node-id=XX-XX (a specific node, not the file root). Step 3: Browse Layers with the Figma Layers Panel (recommended)The Figma Layers panel lets you browse your entire Figma file structure directly inside VSCode — like a file explorer, but for Figma. How to open the panel
Load a Figma file
Explore the layer treeThe tree has unlimited depth. Click the arrow next to any node to expand it: My Design File ← file root └── Home Page ← page (click arrow to expand) └── Header ← frame (click arrow to expand) ├── Logo ← group/component ├── Nav Menu ← group (click arrow to expand further) │ ├── Nav Item 1 │ └── Nav Item 2 └── CTA Button ← component Children are loaded lazily — each level fetches only when you expand it, so large files stay fast. Convert any node to codeClick any node name (frame, group, component, etc.) to convert it. A progress notification appears immediately: "f2c: Converting 'Header' … Fetching Figma node… / Generating code with AI…" You don't need to copy any URL. One click = one conversion. Toolbar buttons (top of the FIGMA LAYERS panel)
Refresh after Figma editsIf you've changed your Figma design, click ↺ Refresh to reload the latest layer tree. Step 3 (alternative): Paste URL directlyIf you know the exact node URL, you can skip the panel: Method 1: Right-click in Explorer panel
Method 2: Right-click inside the editor
Method 3: Command Palette
Step 4: Paste URL and Wait(Only needed when using the URL methods above — panel users skip this step.)
Step 5: Review in Preview PanelAfter generation, a preview panel opens on the right:
Get Pro
To activate: run f2c: Activate Pro License from Cmd+Shift+P, then paste your key. Once activated, the status bar (bottom-right) immediately changes from "f2c 2/3" to "f2c ⚡ Pro". Run f2c: License Status anytime to check your plan, usage, and key details. All Commands
CLI Alternative: f2c-cliIf you prefer working in a terminal, or use a different editor (Vim, WebStorm, Cursor...), you can use f2c-cli — the command-line version of the same tool. Install
One-time setup
The wizard asks for your Figma token and AI API key. Saved to ~/.f2c/config.json. Convert a component
CLI commands
Activate Pro in CLIThe same key from Gumroad works for both the VSCode extension and CLI:
Per-project configCreate .f2crc in your project root to override global settings:
Troubleshooting"Invalid Figma URL" error → Make sure you copied the link from a specific Frame/Component, not the file root. The URL must contain ?node-id=XX-XX "f2c not configured" error → Open settings and make sure figmaToken and ai.apiKey are filled in. "Free plan: daily limit reached" → You've used 3 conversions today. Upgrade to Pro or wait until tomorrow. Preview panel shows but code looks wrong → Try switching to a stronger model (e.g. gpt-4o or claude-sonnet). Complex designs need a powerful model. Right-click menu doesn't show "f2c" option → Make sure the extension is installed and enabled. Right-click on a folder, .tsx, .jsx, .vue, .ts, or .js file in the Explorer. Feedback & IssuesFound a bug or have a feature request? Email: duziteng1987@gmail.com Please include your VSCode version, OS, and a description of the problem. Links
|