A Figma-to-code compiler that converts Figma designs into a Semantic Intermediate Representation (SIR) and then generates front-end code (Vue, TypeScript). Current stable version is 1.0.7, with monthly releases. Key differentiators: uses a structured SIR DSL for intermediate representation, supports interactive prototypes (click/hover) and navigation generation, requires specific Figma file structure (SECTION/FRAME) for correct parsing. Compared to alternatives like Anima or Locofy, it focuses on semantic layer naming and more deterministic code generation but is more opinionated about Figma organization.
npm install figma-sir-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import the compile function, configure the compiler with Figma credentials, and execute the compilation asynchronously.
Restructure Figma file: all pages (FRAME) must be inside a SECTION. Do not nest SECTIONs.
Update Node.js to v16 or later.
Manually create figma.config.json as shown in the README.
Rename layers to English keywords like 'Button Primary', 'Input Email'.
Use async/await or .then() when calling compile().
In Figma, select element, go to Prototype tab, add interaction with trigger and navigate to target frame.
Change to import { compile } from 'figma-sir-compiler' or use dynamic import().Upgrade Node.js to >=16.0.0.
Restructure Figma file: place all page FRAMEs inside SECTION nodes.