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
.htmlfile.
Open the downloaded file in a browser. It should look like your frame, because everything it needs, the styles, the fonts link, the images, is inside that one file.
If the export looks off
A few quick checks, in order:
- Nothing selected? The plugin needs exactly 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.
