HTML to your own Figma components
HTML to Your Own Figma Components: Instances, Not Copies
Import HTML into Figma as instances of your own components: class names like cr-btn--primary pick the right variant and properties, so nothing is duplicated.
- Matching elements become instances of components already in your file or enabled libraries
- Class names pick the variant and properties: cr-btn--primary → Style=Primary
- No match? The component is created once and indexed in a Components section
- Importing the page again creates nothing new
EUREKA! · · 7 min read

You already have a button component. Import a page and most HTML-to-Figma tools hand you a second one: a fresh, auto-generated button that looks like yours but isn't linked to it, so your file ends the day with two button sets. Going from HTML to your own Figma components should mean the opposite: the page uses what you have.
Since v1.1, that's what Components & hover states does in HTML to Frames. A button or card on the page that matches a component in your Figma file, or in a library you've enabled, becomes an instance of your component, with the right variant, component properties, text and image. Only elements that match nothing are created as new components, once, and filed where you can find them.
What "uses your own components" does
- Instances of your components. If the page has a button and your file has a
buttoncomponent set, every button on the page lands as an instance of that set. Your main component is untouched. - The right variant. Class modifiers choose variant values:
.cr-btn.cr-btn--primary.cr-btn--mbecomesbuttonwithStyle=Primary, Size=M. - The right properties. Parts of the element fill component properties: the title text goes into a
Titletext property, a present or missing image flips aShow imageboolean, a badge turns aNewboolean on. - Nothing duplicated. Elements with no match in your file become a new component once, placed in a
Componentssection next to the page and indexed by name. The next import of the same page reuses it.
<a class="cr-btn cr-btn--primary cr-btn--m"> Get the plugin </a>
- cr-btn→button
- --primary→Style = Primary
- --m→Size = M
How it works
- Start from component-based HTML. The page's class names are the signal. Block classes name components, modifiers name variant values and element classes name parts, which is what BEM-style markup (
block,block--modifier,block__element) already gives you. Pages written by an AI from a component skill, design-system documentation sites and hand-coded marketing pages usually qualify without any change. - Import with Components on. With Components & hover states on, the plugin reads the components and component sets in your file (all pages) and in enabled libraries before building.
- Match, then place. For each block on the page the plugin looks for a component with that name, prefix dropped and aliases applied (
cr-btn→btn→button). Abbreviated names match too:rel-cardfinds a component called Related Page Card. The variant is chosen from the element's own modifiers first, then from modifiers inside it (arel-dot--servicepart setsType=Service). Properties are filled from parts:image-card__title→Title,__imagepresent or absent →Show image, abadgepart →New. Modifiers that don't name a variant value (--white,--ghost) pick the closest variant by looks (fill, border and text color) or, for sizes, by the element's measured size, and the result screen tells you which ones were guessed. - No match: create once and index. A block that appears at least twice on the page and has no counterpart in your file becomes a new component (with a
Variantproperty and text/boolean properties from its parts). New components go into a singleComponentssection to the left of the imported screens, one sub-section per component, sorted by name. - Import again: reuse. The same page, or another page of the same site, finds the components it created last time and places instances. Nothing new is made.
Example: markup in, variant out
<a class="cr-btn cr-btn--primary cr-btn--m" href="/pricing/">Get the plugin</a>
<a class="cr-btn cr-btn--secondary cr-btn--s" href="/docs/">Read the docs</a>
<article class="image-card">
<img class="image-card__image" src="lidar.jpg" alt="">
<p class="image-card__eyebrow">Perception</p>
<h3 class="image-card__title">Odin 1 Lite</h3>
<p class="image-card__p">Wide-field LiDAR for mobile robots.</p>
</article>
| On the page | In Figma |
|---|---|
cr-btn cr-btn--primary cr-btn--m | Instance of button, Style=Primary, Size=M, label "Get the plugin" |
cr-btn cr-btn--secondary cr-btn--s | Instance of button, Style=Secondary, Size=S, label "Read the docs" |
image-card with __image, __eyebrow, __title, __p | Instance of image-card, Show image=true, Subtitle, Title, Description filled, image copied |
In our tests on a Figma file with those component sets, a page with 5 buttons, 4 related-page cards and 3 image cards written in plain markup like the one above landed as 12 of 12 instances with the correct variants and values. On the cratustech.com homepage, 22 of 22 buttons became instances of that file's own button set, and a second import created zero new components.
Explicit markup for sites without class names (advanced)
Pages built with utility classes (Tailwind and the like) give the plugin nothing to infer from. If you control the HTML, you can declare the mapping instead: data-figma-component="Button" on the element, data-figma-variant="Style=Primary, Size=M" for the variant, data-figma-prop="Label" on a child (text content → a text property; otherwise its visibility → a boolean) and data-figma-bool="New" for a boolean that's on when the element is present. Plain class names cover the common case; use the attributes only when you need them.
Why it's different
Most HTML-to-Figma tools build components from what they see on the page. In the public docs we reviewed (October 2026), html.to.design describes creating component variants from hover states, and Figma's own Chrome extension binds captured colors to your file's variables. We didn't find a description, in those docs, of imported page elements becoming instances of components that already exist in the user's file.
HTML to Frames treats your file as the source of truth. The page's button doesn't become a new button; it becomes your button, in the variant the page asked for. Combined with Snap to my file's styles for colors and text, an imported page can land fully inside your design system.
| Components built from the page | HTML to Frames | |
|---|---|---|
| Button matching a set in your file | New component next to yours | Instance of your set, variant chosen from class names |
| Card with title, image, badge | New component, overrides on copies | Instance with Title, Show image, New set per card |
| Element with no match | New component | New component, created once, indexed in a Components section |
| Second import of the page | New components again | Reuses what it made; nothing new |
How to use it
- Open the Figma file that holds your components, or enable the library that holds them. Component and property names should match the page's class vocabulary (
button,Style,Size,Title…). - Open HTML to Frames and add a source: Link, Local file, Paste code, Browser or an AI tool over MCP.
- Under Options, keep Components & hover states on. It's on by default on Pro and Team.
- Press Import. The results screen lists what was linked, created, guessed or left unmatched under "Declared components".
- Select any button on the imported frame: the right panel shows your component with its variant and properties, ready to switch.

Components & hover states is a Pro and Team feature. Pro is $7/month at launch and is bought inside Figma.
When it helps most
- Pages written by an AI. Ask Claude or Cursor to write a page using your component skill, send it over MCP, and it arrives built from your real components. The loop from prompt to on-system design closes without a cleanup pass.
- Design-system teams checking a coded site against the library: every matched instance proves the code and the design agree; every "guessed" or "unknown" entry on the result screen points at a drift.
- Agencies with a client library importing the client's live site: the pages come in on the client's own components, so proposals start from the right file.
- Developers who keep the design system in CSS: BEM class names are enough for your localhost pages to land as instances in Figma.
Good to know
- Matching reads class names. Sites with only utility classes, hashed CSS-module names or no meaningful classes don't produce matches; they still get components from repeated structures as before, or you add the
data-figma-*attributes. - Naming matters. Variant values come from modifier names (
--primary→Primary); property names from part names and a short list of synonyms (p/desc→Description,badge→New,image/img→Show image,eyebrow/kicker→Subtitle). - Your set is never edited. If the page asks for a variant your set doesn't have, the closest one is used and reported; the plugin only adds missing variants to sets it created itself.
- Sizes. An instance keeps the component's own size. It fills its row only when the page element is clearly wider (a full-width button), and it's never shrunk.
- Text. With a matched text property, the page's text is set on the instance. A component of yours with no single text property keeps its default text.
- Hidden parts. A part the component has but the page doesn't (a badge) is hidden on the instance; in a main component without Auto Layout that leaves its space empty.
- Components & hover states is a Pro and Team feature, and the file's libraries must be enabled to be searched.
Related
- Website to Figma components with hover variants
- Map website colors to Figma styles you already have
- AI-generated UI to Figma over MCP
- CSS variables to Figma variables
- Compare HTML to Frames with alternatives
Get the plugin, open the file with your components and import a page built on them: the buttons that land are yours.
Frequently asked questions
- Can HTML be imported into Figma as instances of my existing components?
- Yes. With Components & hover states on, HTML to Frames looks for components and component sets in your file and enabled libraries. A page element whose class names match one of them is placed as an instance of that component, with the variant and properties chosen from the class names, and its text and image copied over.
- How does the plugin know which variant to use?
- From the element's class modifiers. A class like cr-btn--primary sets Style=Primary and cr-btn--m sets Size=M; modifiers on inner parts count too. A modifier that doesn't name a variant value picks the closest variant by fill, border and text color, or by measured size, and the result screen lists which ones were guessed.
- What happens when the page has a component my file doesn't?
- It's created once as a new component, with a Variant property and text or boolean properties taken from its parts, and placed in a Components section to the left of the imported screens, sorted by name. Importing the same page again finds that component and places instances instead of creating another one.
- Does it work on any website?
- It works on pages with meaningful class names, such as BEM-style markup, design-system documentation sites and pages written by an AI from a component skill. Sites that only use utility classes or hashed class names give nothing to match, so they get components from repeated structures as before, or you can add data-figma-component attributes if you control the HTML.
- Will the import change my main components?
- No. Your main components and component sets are read, never edited. If a requested variant is missing from your set, the closest existing variant is used and reported on the results screen. Missing variants are only added to component sets the plugin created itself.
Stop redrawing the web.
Paste a link and get real, editable, responsive Figma layers in seconds. Free to start — 10 imports every month.


