Tutorial: Extracting Production-Ready Code from Figma with the Atomic Design Extractor
If you've ever copied hex codes out of Figma by hand or rebuilt a card component for the third time because the design changed, this tutorial is for you. The Atomic Design Extractor is a Figma plugin built by Current Labs that reads your design system and generates framework-ready code — complete with design tokens, component structure, and proper naming.
Here's how to use it, from install to export.
What It Does
The Atomic Design Extractor analyzes your Figma components and does three things:
- Classifies each component using atomic design principles (atom, molecule, organism, template, page)
- Extracts design tokens — colors, typography, spacing, border radii, shadows — as structured variables instead of hardcoded values
- Generates component code for your target framework, referencing those tokens
The result is code that looks like something a developer wrote, not something a tool spit out.
Getting Started
Prerequisites
- A Figma account (free or paid)
- A design file with at least a few components — buttons, cards, nav elements, or anything reusable
- Components should use Figma's built-in features: auto layout, component properties, and variables where possible. The more structured your design, the better the output.
Install the Plugin
- Open Figma and navigate to Plugins > Browse plugins in Community
- Search for Atomic Design Extractor by Current Labs
- Click Install
- The plugin will appear in your Plugins menu in any design file
Step-by-Step Walkthrough
Step 1: Select Your Components
Select the components you want to extract. You can select individual components, a component set, or an entire frame containing multiple components.
Tip: Start with a small set — a button, a card, and a text input. This gives you a feel for the output before running it on your entire design system.
Step 2: Launch the Plugin
Go to Plugins > Atomic Design Extractor and open it. The plugin window will show a summary of what you've selected: component count, detected variants, and a preview of the atomic classification.
Review the classification. The plugin uses heuristics to determine whether something is an atom (a single-purpose element like a button) or a molecule (a composed element like a search bar). You can override these if the automatic classification doesn't match your mental model.
Step 3: Extract Design Tokens
Click Extract Tokens. The plugin walks through every selected component and pulls out:
- Colors — fill colors, stroke colors, and text colors, mapped to named tokens
- Typography — font family, size, weight, line height, and letter spacing
- Spacing — padding and gap values from auto layout
- Effects — shadows, blurs, and other layer effects
- Border radii — corner radius values
Each value is deduplicated and grouped. If three components use the same blue (#2A6AF6), the plugin creates one token (color-primary) and references it everywhere.
Step 4: Generate Code
Choose your target framework from the dropdown:
- React (JSX + CSS Modules or Styled Components)
- Vue (SFC with scoped styles)
- Svelte (component files with scoped styles)
- HTML/CSS (vanilla, no framework)
Click Generate. The plugin produces one file per component, plus a shared tokens file (CSS custom properties, SCSS variables, or a JSON token file — your choice).
Step 5: Export
You have two export options:
- Download as ZIP — get all generated files in a single archive, ready to drop into your project
- Copy to clipboard — copy individual component code for quick pasting
The ZIP option includes a tokens/ directory with your design tokens and a components/ directory organized by atomic level.
Supported Frameworks
| Framework | Output Format | Token Format |
|---|---|---|
| React | JSX + CSS Modules | CSS custom properties |
| Vue | SFC (.vue) |
CSS custom properties |
| Svelte | .svelte files |
CSS custom properties |
| HTML/CSS | Semantic HTML + CSS | CSS custom properties |
| Any | JSON tokens only | JSON / SCSS variables |
Tips and Best Practices
Name your Figma components well. The plugin uses your component names to generate code identifiers. Button/Primary/Large produces cleaner code than Frame 47.
Use auto layout consistently. Auto layout maps directly to flexbox in the generated code. Components without auto layout fall back to absolute positioning, which is harder to maintain.
Leverage Figma variables. If you've already defined color and spacing variables in Figma, the plugin will use those names for your tokens — creating a direct link between your design system and your codebase.
Run extraction iteratively. Don't try to extract 200 components at once on your first pass. Start small, review the output, adjust your Figma structure if needed, then scale up.
Review before shipping. The generated code is a strong starting point, but it benefits from a developer's eye. Check responsive behavior, accessibility attributes, and interaction states that the static design can't fully capture.
What's Next
The Atomic Design Extractor is the first tool in the AI.D methodology pipeline. It handles the extraction and generation steps, while the broader Current platform (coming soon) will add continuous sync, team collaboration, and version-aware updates.
If you want to try the plugin, sign up for early access and we'll get you set up.