Skip to content
SnapDOMTry SnapStudioGitHub★ 8K
Vector · Figma

HTML to editable SVG and Figma with SnapDOM Vector

Turn a live component into editable SVG artwork and Figma clipboard output. Try a product card and review fonts, layers and conversion limits.

From a shipped component to editable artwork

To edit a captured component in a design tool, its labels need to stay text and its shapes need to stay shapes. PNG exports keep pixels. Core SVG captures embed HTML in a foreignObject.

SnapDOM's Vector plugin reads the rendered DOM to measure text and shapes and reconstructs the supported parts as standalone SVG artwork. Its Figma clipboard export is a second destination for the same capture.

Three outputs with different jobs

PNG: a picture of the component

PNG shows someone how the component looks. They cannot edit its labels as text or move its shapes separately.

SnapDOM’s regular SVG: HTML stored inside an SVG file

toSvg() keeps the captured HTML inside an SVG container, using foreignObject. Good for displaying the capture in a compatible browser; a design tool may not support that HTML content.

The .svg extension alone does not make the component’s text and shapes editable in Figma.

Vector plugin: text and shapes you can edit

toVector() converts supported parts of the component into SVG text and shapes, for when someone needs to change a label or edit the artwork in a vector editor.

For Figma, use the plugin’s separate toFigma() clipboard export and check the pasted result: fonts and some visual effects may differ from the browser.

Check how an SVG stores its content before sending it to a vector editor. The HTML-to-SVG recipe covers the capture route; Vector is a separate plugin with a different output contract.

Try a product card, then inspect the SVG

Edit the product name, export the card and download its SVG. Open it in your vector editor, find the title and change it. The demo reports how many SVG text elements and foreignObject elements the exported file contains; check the imported result in your own editor.

For charts and inline illustrations, use the Vector playground. Start with ordinary text, borders and gradients before effects your destination may approximate.

Install and capture once

npm install @zumer/snapdom@3 @zumer/snapdom-vector
import { snapdom } from '@zumer/snapdom';
import { vector } from '@zumer/snapdom-vector';
const card = document.querySelector('#product-card');
const result = await snapdom(card, { plugins: [vector()] });
const svg = await result.toVector();
// Wire this after capture has finished, on HTTPS or localhost:
copyButton.addEventListener('click', () => result.toFigma());

toVector() returns an SVG string. toFigma() writes the clipboard and resolves without returning artwork. Keep the source connected through export, and register the plugin only on the captures that need it. The public plugin option is exclude; do not copy historical internal engine settings into your application.

The Figma handoff

Generate first, click Copy to Figma, then paste into a Figma design file. Clipboard access needs HTTPS or localhost and browser permission. A successful clipboard write confirms transport only; the paste happens inside Figma, and the pasted layers need their own inspection.

The public clipboard route does not need the optional development Figma plugin. That separate consumer accepts the internal SVD-derived payload (not arbitrary SVG) and offers font preflight.

Verify that the title is editable, the intended font is available, gradients and shadows look right, and the group contains the expected layers. The exported layers are positioned; add Auto Layout, reusable components and design tokens in Figma if the design needs them.

Font and effect fidelity are part of the review

Editable text needs an available font. Figma distinguishes missing fonts from fonts not yet loaded, and its text API documentation explains why a text node can look right yet still need its font before editing. Agree on a fallback with the recipient rather than substituting silently.

SVG and Figma are different renderers. The conversion engine can diagnose or approximate unsupported paint, so review complex masks, filters, text shaping and clipped content in the destination itself. The export contains the chart artwork; the data stays in the application.

For a designer-developer handoff, keep a PNG reference beside the vector file to spot rendering differences in the imported artwork.

Next steps and sources

Read capture options and capture boundaries before exporting a real component. For document output, see the PDF comparison; for an agent checking an implementation against a reference, the Claude Code workflow.

Sources checked October 5, 2026: Vector public API, clipboard adapter, optional Figma consumer, and plugins 4.0.0.

SnapDOM Vector vs html.to.design

The html.to.design plugin by divRIOTS documents a URL-import workflow, viewport selection and a Chrome extension for pages behind login. That fits a job that starts inside Figma with an existing website.

SnapDOM Vector starts inside the running app: your code selects an element and exports it through the capture pipeline, for a component export button or a handoff from the app. Compare the same component in Figma before choosing.