figspec

Unofficial static Figma frame/file viewer available as HTML CustomElement

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
import { FigspecFrameViewer } from "../src";

import * as demoFrame from "./examples/demo-data/Klm6pxIZSaJFiOMX5FpTul9F/64:1.json";
import demoImage from "./examples/demo-data/Klm6pxIZSaJFiOMX5FpTul9F/64:1.svg";

const demo = document.getElementById("frame_demo");

if (demo && demo instanceof FigspecFrameViewer) {
  // @ts-ignore: It's machine-generated data and library types. Nothing I can do here.
  demo.nodes = demoFrame;
  demo.renderedImage = demoImage;
}