Getting started
This walks through your first export, start to finish.
Install the plugin
If you have the published plugin, add it from the Figma community and skip to the next step.
To run it from source:
- Clone the repository and run
npm install, thennpm run build. This producescode.jsandui.html, the two files Figma loads. - In Figma, open Plugins → Development → Import plugin from manifest.
- Pick the
manifest.jsonin the project root.
The plugin now shows up under Plugins → Development → Design to HTML.
Run your first export
- Select one layer. A frame, component, instance, or group. Select the outermost thing you want as the page. The plugin exports that node and everything inside it.
- Open the plugin. A panel opens with two choices at the top.
- Pick your styling: CSS or Tailwind. If you are not sure, start with CSS.
- Leave semantic tags on unless you have a reason to turn them off. They give you real HTML tags instead of a pile of
divs. - Click Export selected frame. The preview fills with the generated HTML.
- Copy the code, or download the file. Pages with images come out as a
.zipholdingindex.html,styles.cssand animages/folder; pages without images are a single.html.
Open it in a browser (unzip first, if you got a zip, and open index.html). It should look like your frame: the styles, the fonts link and the images all come with it.
If the export looks off
A few quick checks, in order:
- Nothing selected? The plugin needs at least one selected layer. Select the frame and run it again.
- Everything is absolutely positioned? Your frame is not using auto layout. See Use auto layout.
- Titles are plain paragraphs? The plugin did not see them as headings. See Headings and text.
- A tag is wrong or missing? The layer name drives it. See Name your layers.
What to read next
Once you have a working export, the next three pages are about designing the frame so the export comes out clean the first time. Start with naming your layers.
Designing the same page at several widths? Select all the frames at once and see Responsive export.
