Use Case · Astro

Last reviewed: March 2026

Astro to Figma —
Zero-JS, Pure HTML

Converting Astro sites to Figma is especially clean because Astro ships zero JavaScript by default — pages render as pure, semantic HTML in the browser. Run the dev server, copy the rendered HTML from DevTools, paste it into html2design, and get native Figma layers that reflect exactly what the browser renders.

What is "Astro to Figma"?

"Astro to Figma" refers to exporting a rendered Astro page or component — with its styles, layout, and content — into a native Figma design that designers can edit directly. Astro is an island-architecture framework that generates minimal HTML with zero JavaScript overhead by default. Pages are pre-rendered to static HTML at build time, and interactive UI islands are hydrated only where needed.

The html2design Figma plugin accepts the rendered HTML you copy from your browser's DevTools and converts it into native Figma frames. Astro scopes component styles using unique class identifiers that the browser resolves to computed CSS values before the plugin reads them. The result is a pixel-accurate representation of your Astro page — with real text layers, accurate spacing, and correct colors from your design tokens or Tailwind configuration.

The Astro to Figma workflow

Four steps. Works with Astro 3+, Astro 4+, static output, SSR mode, and any UI framework used as Astro Islands.

Step 01

Run the Astro dev server

Start the dev server with npm run dev or npx astro dev. Astro's dev server starts in seconds and serves pages with hot module replacement. Navigate to the page or section you want to capture.

For static sites, you can also run npm run build && npm run preview to capture the final production output. Use the dev server for iteration speed and the preview build when you need the exact final rendered state.

Step 02

Copy the rendered HTML from DevTools

Open DevTools (F12) and switch to the Elements panel. Find the root element of the section you want — typically a <section>, <header>, or <main> element.

Right-click the element → Copy > Copy outerHTML. For an Astro Island (a hydrated React, Vue, or Svelte component), wait for the island to hydrate before copying — you'll see the client-side content rendered in the Elements panel once hydration is complete.

Step 03

Paste into html2design and generate Figma layers

Open Figma, run the HTML to Figma plugin, paste the copied HTML, and click Generate. Astro's scoped styles are compiled to unique identifiers at build time and resolved by the browser before you copy. The plugin reads computed CSS values directly — not the .astro source files — so the output is a true representation of the rendered page.

If your Astro project uses Tailwind CSS, every utility class is already resolved to pixel values by the browser. You get exact spacing, colors, and typography in Figma without any manual mapping.

Step 04

Share the Figma frame with your designer

Share the Figma frame link. Your designer gets an editable version of the exact page — not a screenshot, not a wireframe — and can iterate on spacing, typography, and color directly in Figma. No Astro experience required on their end.

When the Astro page changes, re-import: run the dev server, copy the updated outerHTML, paste into html2design. The workflow takes under two minutes and keeps Figma in sync with the live codebase.

Astro-specific tips for better Figma output

Astro's island architecture and zero-JS default have some unique characteristics — here's how to work with them for the cleanest import.

Copy from DevTools, not page source

Astro pages may include Island components that hydrate after the initial HTML load. Always copy from the browser's DevTools Elements panel — not from "View Page Source" — to ensure you capture the fully hydrated state. Islands using client:load, client:visible, or client:idle render their content in DevTools once hydration completes.

Scoped styles compile to unique identifiers

Astro scopes <style> blocks in .astro component files using unique class suffixes (e.g., .astro-XXXXXXXX). The browser resolves these to their computed values — html2design reads the computed CSS, so scoped styles are completely transparent to the import process and appear correctly in Figma.

Tailwind + Astro: zero extra steps

Astro has first-class Tailwind CSS integration via @astrojs/tailwind. When you copy outerHTML from an Astro + Tailwind page, every utility class is already resolved to its pixel value by the browser. You get exact spacing, colors from your tailwind.config, and typography in Figma — without any manual design token mapping.

Content Collections: capture the rendered output

Astro's Content Collections power blog posts, documentation pages, and data-driven layouts. The collection data is fetched at build time and embedded into the rendered HTML. Navigate to the page in your browser, wait for it to fully render, then copy the outerHTML — the content (headings, paragraphs, images) will be fully present in the DevTools output.

Why Astro output is especially clean in Figma

Astro's ship-zero-JS philosophy produces lean, semantic HTML — which means cleaner Figma imports than framework-runtime models.

Zero JavaScript overhead in the output

Astro removes all framework runtime code from static pages by default. No React fiber, no Vue reactivity runtime, no Angular decorators — just clean HTML and CSS. The imported Figma layers reflect pure semantic structure.

Semantic HTML output

Astro encourages using semantic HTML elements — <header>, <section>, <article>, <nav>. These map to meaningful Figma layer names without the noise of framework-generated wrapper divs.

CSS custom properties resolve cleanly

Astro projects often use CSS custom properties for design tokens — colors, spacing, typography. The browser resolves var(--color-brand) to its real hex value, so Figma fills reflect your actual design system.

Islands are captured at hydration state

Interactive islands (React, Vue, Svelte components embedded in Astro) are captured as their current rendered state. Toggle a UI state, fill a form, or expand an accordion — then copy the outerHTML to capture that exact visual state in Figma.

Frequently asked questions

How do I convert an Astro site to Figma?

Run npm run dev, open the page in a browser, copy the section's outerHTML from DevTools, and paste into html2design in Figma. The plugin converts the rendered HTML into native Figma layers — no extension, no public URL required.

Do Astro's scoped styles affect the Figma import?

No. Astro compiles scoped styles to unique class identifiers that the browser resolves to computed CSS values. html2design reads computed CSS — not source stylesheets — so scoped styles appear correctly in Figma without any special handling.

Can I import Astro Island components into Figma?

Yes. Astro Islands hydrate in the browser — once hydrated, the component's HTML is visible in the DevTools Elements panel. Copy the outerHTML after hydration and paste into html2design to import the island's rendered output as native Figma layers.

Does Astro's static output differ from SSR mode for Figma import?

No difference. Both modes render HTML in the browser. Use the DevTools Elements panel in either case — always copy from there rather than page source to capture the fully rendered, hydrated state.

Related Guides

Export your Astro site to Figma today

Install html2design from the Figma Community — free to try, works with Astro 3+, Astro 4+, and any UI framework used as Islands.

Install Free on Figma Community

Free to try · $12/mo to unlock all features