Figma → Code
Turn Figma frames into React, Vue, or Svelte components instantly.
Right-click a frame in Figma → Copy link to selection
Token is used only to call Figma APIs via our proxy route for preview/export. Generate at Figma Settings → Personal Access Tokens.
1. Get a Personal Access Token (PAT)
- 1.In Figma, click your avatar (top-left corner) → Settings
- 2.Scroll to Security → Personal access tokens → Generate new token
- 3.Give it any name (e.g. CodeAlchemy), set expiration
- 4.Scopes: check ONLY file_content:read under Files — leave everything else unchecked
- 5.Click Generate token → copy it (starts with figd_)
2. Get the frame URL
- 1.Open your Figma file and click on a Frame (frames with Auto Layout work best)
- 2.Right-click the frame → Copy/Paste as → Copy link to selection
- 3.Paste the URL here — it looks like:
figma.com/design/KEY/name?node-id=103-49
Supported: auto-layout frames, absolute-positioned layers, text, raster images and vector icons (downloaded as PNG/SVG when you click Download ZIP). Shadows and gradients are still limited.
Frequently asked questions
Is my Figma token safe?↓
Your PAT is sent from your browser in request headers to our conversion routes, which immediately forward it to Figma over HTTPS and do not persist it.
Which PAT scope do I need?↓
Only one: file_content:read (under "Files" in the token dialog). Leave all other scopes unchecked — that is the minimum permission needed to read frame data.
What Figma nodes are supported?↓
Frames/Groups/Components/Instances, Text nodes, Rectangles/Ellipses with image fills (downloaded as PNG), and Vector/Boolean/Star/Line shapes (downloaded as SVG). The converter now mixes flex + absolute positioning for better fidelity. Blend modes, shadows, and gradients are still limited.
What’s inside the Download ZIP archive?↓
A folder with: 1) the generated component file (.tsx/.vue/.svelte), 2) assets/images/ with all raster images as PNG, 3) assets/icons/ with all vectors as SVG, 4) a README.md describing the contents. Nothing is stored on our server — assets are fetched from Figma in memory and streamed back to you.
What’s the difference between Tailwind, Inline, and CSS Module?↓
Tailwind: utility classes (flex, gap-4, text-lg…). Inline: style={{}} objects on each element. CSS Module: className={styles.xxx} with a .module.css comment block you save alongside the component.
Can I use this with Figma Community files?↓
Yes, as long as you have view access to the file and a valid PAT, the tool can fetch any node you can see.
Try other tools
View allTailwind ↔ CSS
Convert Tailwind classes to vanilla CSS and back. Instant. Client-side.
Palette → Tokens
Turn a color palette into CSS variables, Tailwind config, and Token Studio JSON.
OpenAPI → TS
Generate TypeScript interfaces and Zod schemas from any OpenAPI spec.
Long-form guide
Export Figma frames into React, Vue, or Svelte components
Figma → Code turns the design that's in your Figma file into the JSX, Vue SFC, or Svelte component that's in your repo. The conversion is client-side: you paste a Figma file URL and your personal access token, and the tool fetches the selected node directly from api.figma.com using your browser. Your token never leaves your machine in transit unless our backup proxy route is needed for a CORS edge case, in which case it's forwarded to Figma over HTTPS and never persisted.
How to use it
- Generate a PAT. In Figma, click your avatar → Settings → Security → Personal access tokens → Generate new token. Give it a name like
CodeAlchemy, set an expiration (90 days is a sane default), and check only thefile_content:readscope. Copy the token — it begins withfigd_. - Get the frame URL. Open the Figma file you want to export. Click on the specific frame you want — auto-layout frames work best, but absolutely-positioned designs also work. Right-click → Copy/Paste as → Copy link to selection. That URL contains both the file key and the node id.
- Paste both into the tool. URL goes in the top field; token goes below. Toggle Remember if you'd like the PAT to survive between sessions in
localStorage(uncheck and click Fetch to clear it). - Pick your target. Choose React + TypeScript (default), Vue 3 SFC, or Svelte. Then pick a style strategy: Tailwind classes (most common), inline
styleobjects (good for one-off exports), or CSS Modules (good for projects with co-located stylesheets). - Click Fetch & Convert. The tool calls Figma, parses the node tree into an intermediate representation, and emits component code on the right panel. Expect this to take 1–4 seconds depending on frame complexity.
- Download the ZIP. Use the Download ZIP button to get a folder with your component file, raster images as PNG in
assets/images/, vectors as SVG inassets/icons/, and aREADME.mdthat explains where everything came from.
What's supported, what's still expanding
Auto-layout is a first-class citizen. The converter walks the layout tree and produces matching flex rules with the correct gap, padding, and alignment. Absolute positioning is detected and emitted as a hybrid — flex for the wrapper, absolute children for layered elements like badges or icons.
Text nodes carry their font family, weight, size, line height, letter spacing, and color. Image fills are downloaded and referenced from the assets folder. Vector shapes (icons, illustrations) are downloaded as SVG and either inlined or imported, depending on your settings.
Effects are partial. Solid drop shadows, simple inner shadows, and basic linear gradients are emitted. More complex effects — layered shadows, conic and radial gradients with multiple stops, blend modes, and backdrop blurs — are still being expanded. When the converter doesn't know how to express something, it leaves a comment in the output instead of silently dropping it.
When to reach for it
The big use case is starting a new component from an approved design. Instead of staring at the frame and re-typing class names, you paste the URL and get a scaffold. From there you wire props, hook up state, and replace placeholders — but the structure, spacing, and base styles are already done.
It's also useful for reviewing implementations. Paste a frame, paste your component, see if they agree on padding and font weights. Or convert a design system primitive into reference code so a new contributor can compare implementations across React and Vue without rebuilding it twice.
Figma → Code превращает дизайн из твоего Figma-файла в JSX, Vue SFC или Svelte-компонент в твоём репо. Конвертация на клиенте: ты вставляешь URL Figma-файла и персональный токен, инструмент достаёт выбранный узел прямо с api.figma.com через твой браузер. Токен никогда не покидает машину в транзите — кроме случаев, когда срабатывает резервный прокси для CORS, и тогда он передаётся в Figma по HTTPS и нигде не сохраняется.
Как использовать
- Создай PAT. В Figma нажми на аватар → Settings → Security → Personal access tokens → Generate new token. Дай имя (например,
CodeAlchemy), задай срок жизни (90 дней — разумный дефолт) и отметь только scopefile_content:read. Скопируй токен — он начинается сfigd_. - Получи URL фрейма. Открой Figma-файл, кликни на нужный фрейм — фреймы с auto-layout работают лучше всего, но абсолютные дизайны тоже подходят. ПКМ → Copy/Paste as → Copy link to selection. В URL уже есть и file key, и node id.
- Вставь оба значения в инструмент. URL — в верхнее поле, токен — ниже. Включи Запомнить, если хочешь, чтобы PAT сохранился между сессиями в
localStorage(сними галочку и нажми Fetch, чтобы очистить). - Выбери target. React + TypeScript (по умолчанию), Vue 3 SFC или Svelte. Дальше — стиль: Tailwind-классы (чаще всего), inline
styleобъекты (для разовых экспортов), или CSS-модули (если в проекте принято хранить стили рядом). - Нажми Fetch & Convert. Инструмент обращается к Figma, разбирает дерево узлов в промежуточное представление и выдаёт код в правой панели. На сложные фреймы уходит 1–4 секунды.
- Скачай ZIP. Кнопка Download ZIP даёт папку с файлом компонента, растровыми изображениями в PNG (
assets/images/), векторами в SVG (assets/icons/) и README.md с описанием.
Что поддерживается, что ещё дорабатывается
Auto-layout — первоклассный гражданин. Конвертер обходит дерево layout и выдаёт flex-правила с правильными gap, padding и alignment. Абсолютное позиционирование определяется и выводится в гибридной форме — flex для обёртки, absolute для дочерних слоёв вроде бейджей или иконок.
Текстовые узлы несут с собой font family, weight, size, line height, letter spacing и цвет. Заливки изображениями скачиваются и подключаются из папки assets. Вектора (иконки, иллюстрации) скачиваются как SVG и либо инлайнятся, либо импортируются — по настройкам.
Эффекты пока частично. Сплошные drop shadow, простые inner shadow и базовые линейные градиенты выводятся. Более сложные эффекты — многослойные тени, конические и радиальные градиенты с несколькими стопами, blend modes, backdrop blur — в работе. Когда конвертер не знает, как выразить эффект, он оставляет комментарий в выводе вместо тихой потери.
Когда это пригодится
Главный кейс — начать новый компонент с готового дизайна. Вместо того чтобы смотреть на фрейм и руками набирать имена классов, ты вставляешь URL и получаешь скелет. Дальше — пропсы, состояние, замена плейсхолдеров — но структура, отступы и базовые стили уже на месте.
Ещё это полезно для ревью реализаций. Вставил фрейм, вставил свой компонент — увидел, согласны ли они по padding и font weights. Или конвертируешь примитив дизайн-системы в эталонный код, чтобы новый контрибьютор мог сравнить реализации на React и Vue без двойного билда.
Examples
Frame: PricingCard Auto-layout vertical, gap 16, padding 24 Text: 'Pro' (sm, semibold) Text: '$19' (xl, bold) Button: 'Choose plan' (filled, brand)
export function PricingCard() {
return (
<div className="flex flex-col gap-4 p-6 rounded-xl border">
<span className="text-sm font-semibold">Pro</span>
<span className="text-xl font-bold">$19</span>
<button className="px-4 py-2 rounded-lg bg-brand-500 text-white">
Choose plan
</button>
</div>
);
}Frame: Hero Auto-layout horizontal, gap 32, align center Rectangle (image fill: hero.png), 480x320 Text: 'Welcome to CodeAlchemy' (3xl)
export function Hero() {
return (
<section className="flex items-center gap-8">
<img src="/assets/images/hero.png" alt="" width={480} height={320} />
<h1 className="text-3xl font-semibold">Welcome to CodeAlchemy</h1>
</section>
);
}Frame: Tag Auto-layout horizontal, gap 6, padding 6/12 Background: #3dc96c Corner radius 999 Text: 'New' (xs, white)
<template>
<span :style="{ display: 'inline-flex', alignItems: 'center', gap: '6px', padding: '6px 12px', background: '#3dc96c', borderRadius: '999px', color: '#fff', fontSize: '12px' }">
New
</span>
</template>