Component library import into Figma is the process of converting an existing HTML/CSS component library — such as a React, Vue, or plain HTML design system — into native, editable Figma components by copying rendered HTML from each component and converting it with the html2design plugin. The result is a Figma library that reflects exactly what ships in production.
Why You Need This Workflow
Many engineering teams build component libraries before — or without — a dedicated design system in Figma. The components exist in code, render correctly in the browser, and are used across the product. But there's no Figma file to hand off to designers, no shared library for the design team to extend, and no visual documentation of what the library actually looks like.
The manual path — recreating every button variant, every form state, every card layout from scratch in Figma — is prohibitively slow. A 40-component library with 3–5 variants each means 120–200 individual frames to draw by hand. At 20–40 minutes per frame, that's weeks of work.
html2design cuts that to hours. You render the component in a browser, copy its outerHTML from DevTools, paste it into the plugin, and get a native Figma frame with preserved typography, spacing, colors, and borders. One component in under 60 seconds.
Prerequisites
- The html2design plugin installed in Figma ($12/mo or $96/yr)
- A component render environment: Storybook, a dev server, or static HTML pages
- Browser DevTools (Chrome, Firefox, or Edge)
- A Figma file to use as your component library destination
Phase 1: Audit and Categorize Your Library
Before importing, build a complete inventory of your components. Group them into tiers to prioritize the import order:
- Tier 1 — Atoms: Button (all variants), Input, Textarea, Checkbox, Radio, Toggle, Badge, Icon, Avatar, Tag
- Tier 2 — Molecules: Card, Form group, Alert, Toast, Modal, Dropdown, Tooltip, Accordion, Tab
- Tier 3 — Organisms: Navigation bar, Sidebar, Header, Footer, Data table, Form
- Tier 4 — Templates: Page layouts, dashboard shells, auth screens
Import Tier 1 first. These are the most reused components — getting them into Figma quickly unlocks the most value for designers. Tier 4 can often wait or be assembled from already-imported atoms and molecules.
For each component, list the variants you need: states (default, hover, disabled, error), sizes (sm, md, lg), and themes (light, dark). Each variant will be a separate import pass.
Storybook tip: If your library is in Storybook, use the Canvas view for each story — it shows the component in isolation with the correct background and sizing. The URL format /story/component-name--variant makes it easy to iterate through all variants systematically.
Phase 2: Set Up Your Render Environment
You want each component rendered in isolation — no page chrome, no sidebar, no competing styles. Clean isolation produces cleaner Figma output.
The cleanest option is Storybook's canvas view. If you don't have Storybook, create a simple HTML test page that renders one component at a time:
Using a white or neutral background is important — html2design reads background fills from the rendered output, so a dark or patterned page background can pollute the imported layer.
Phase 3: The Import Workflow
Open DevTools and locate the component root
Right-click your rendered component in the browser → Inspect. In the Elements panel, find the outermost element of the component — typically a <div> or <button> with the component's root class. This is the element you'll copy.
Avoid selecting a parent wrapper that spans the full viewport. You want the component's own root, not the page layout around it.
Copy outerHTML
Right-click the root element in DevTools → Copy → Copy outerHTML. This copies the full HTML markup including all child elements, with all resolved class names and inline styles.
If your component uses CSS custom properties (variables), switch to the Computed tab in DevTools and check whether the values look correct. html2design reads computed CSS, so custom properties are resolved automatically.
Convert in html2design
In Figma, open the html2design plugin (Plugins → html2design). Paste your HTML into the input field. Click Convert. The plugin generates a native Figma frame on the canvas in 2–5 seconds.
Rename the frame immediately
Before moving on to the next component, rename the frame in the Figma layers panel using your naming convention. A consistent format like Button/Primary/Default or Card/Default makes it easy to use the variants feature later.
Renaming as you go is much faster than renaming 80 frames after the fact.
Repeat for each variant
Return to the browser, render the next variant (disabled state, different size, dark mode), copy, and convert. Stack variants horizontally on the Figma canvas — this makes it easy to visually compare states and apply Auto Layout later.
Phase 4: Organize and Clean Up in Figma
Once you've imported a full component group (e.g. all button variants), organize the Figma file:
- One page per component group — Page: Buttons, Page: Inputs, Page: Cards. This makes navigation fast and prevents the canvas from becoming overwhelming.
- Frame → Component — Select each imported frame and press Cmd+Alt+K (Create Component). Set properties and variants as needed.
- Group variants with Combine as Variants — Select all variants of a component, right-click → Combine as Variants. Figma creates a component set automatically.
- Add Auto Layout — Many imported frames use fixed positioning. Review each component and apply Auto Layout where the design should be fluid.
Phase 5: Extract and Apply Design Tokens
html2design preserves the rendered CSS values — your exact colors, spacing, and typography — in the imported layers. This makes it straightforward to extract design tokens and set up Figma Variables:
- Select a component and inspect the layers to find recurring values. Your primary color, border radius, and spacing scale should appear consistently across multiple layers.
- In Figma, open Local Variables and create your token groups: Color, Spacing, Radius, Typography.
- Manually enter the token values from your codebase (or read them from the imported layers — they should match your CSS custom properties).
- Apply Variables to the imported component layers by selecting fills, strokes, and spacing values and linking them to the corresponding Variable.
This is the most time-intensive step, but it's a one-time setup. Once Figma Variables are applied, your library becomes truly token-driven — changing a color Variable updates every component that uses it.
Token reference page approach: Create a dedicated page in Figma with one imported element per token — a 24×24px square for each color token, a text layer for each typography token, a rectangle for each spacing token. This gives you visual anchors for setting up Variables without having to hunt through component layers.
Phase 6: Publish as a Figma Library
Once your components are imported, cleaned up, and token-linked:
- Open Assets → Team Library in Figma.
- Click Publish. Figma publishes all components and styles in this file as a shared library.
- Other team members can now enable this library in their files and use your components via the Assets panel.
Going forward, when engineers ship changes to a component, re-import the updated HTML to get a fresh Figma version, compare with the existing component, and update the library. This keeps design and code in sync without a full manual rebuild.
Frequently Asked Questions
How do I import a React component library into Figma?
Render each React component in a browser (Storybook is ideal — use the canvas view), copy the rendered outerHTML from DevTools, and paste it into the html2design plugin. React renders to HTML, so the plugin sees computed CSS regardless of whether the component uses Tailwind, CSS Modules, styled-components, or Emotion.
Can I import design tokens along with the components?
html2design preserves the rendered CSS values of each imported component. The colors, spacing, and typography in the Figma layers will match your token values exactly. You then create Figma Variables manually with those same values and apply them to the imported layers. It's two steps, but the imported values make the setup much faster — you're not guessing.
What about component interactions and hover states?
html2design imports a static snapshot — what the component looks like in one state at the time you copy the HTML. For interactive states (hover, focus, active, disabled), you import each state separately by triggering the state in the browser before copying. In Figma, combine these as Variants to create interactive prototypes.
Key Takeaways
- ✓ Audit components first — import atoms before organisms, most-used before least-used
- ✓ Storybook canvas view is the cleanest source — isolated components on a neutral background
- ✓ Rename frames as you import —
Button/Primary/Defaultnaming enables Figma Variants later - ✓ Import each interactive state (hover, disabled, error) separately and combine as Variants
- ✓ A 40-component library takes 2–4 hours via html2design versus 2–4 weeks manually
Related Articles
The Complete Guide to HTML to Figma Conversion (2026) →
The pillar guide covering every framework, every method, and every use case — all in one place.
Design System Migration: From Code to Figma Components →
The broader design system migration workflow — token auditing, component prioritization, and preventing drift.
Design Tokens: Bridging Code and Figma →
Sync design tokens between your codebase and Figma Variables using the token reference page pattern.
How to Convert React Components to Figma Designs →
React renders to HTML — convert any component from Storybook, Next.js, or localhost directly.
Tailwind to Figma: Build a Design System from Your Tailwind Components →
Extract Tailwind tokens as Figma Variables, convert the component library, and keep code and design in sync.
Storybook to Figma: Build a Component Library from Stories →
Systematically export every component story to Figma to build a complete, always-in-sync component library.
Try it now
Import your first component in 30 seconds
Copy any component from Storybook or DevTools. Paste into html2design. Get a native Figma frame with preserved design tokens instantly.
Install from Figma Community →$12/mo · $96/yr · Cancel anytime