Skip to content

hvaltchev/html-to-figma

 
 

Repository files navigation

html-figma

WORK IN PROGRESS

Converts DOM nodes to Figma nodes.

Inspired by figma-html.

DEMO: https://www.figma.com/community/plugin/1005496056687344906/html-to-figma-DEV-plugin

Example: /dev-plugin

npm i html-figma

USAGE

Browser

import { htmlTofigma } from 'html-figma/browser';

const element = document.getElementById('#element-to-export');

const layersMeta = await htmlTofigma(element);

Figma

import { addLayersToFrame } from 'html-figma/figma';

const rootNode = figma.currentPage;

await addLayersToFrame(layersMeta, rootNode);

About

Convert DOM node to Figma node

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 84.0%
  • HTML 9.9%
  • JavaScript 6.1%