ddanielbee / figma-fsm

Figma prototype file to XState syntax Finite State Machine representation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

figma-fsm

Convert Figma Prototype files to Xstate compatible Finite State Machine objects. It uses the Figma REST api to retrieve a file and transforms it into a Finite State Machine that can be visualized here

🆕 Try it out with an UI here: Figma FSM UI

Installation

The best way is to use npm

npm install figma-fsm

Usage

In Node

const figmaFSM = require("figma-fsm")

figmaFSM(<FigmaToken>, <FigmaFileKey>)
  .then(result => // Do something with your result).

In Typescript

import figmaFSM from "figma-fsm";

figmaFSM(<FigmaToken>, <FigmaFileKey>)
  .then(result => // Do something with your result).

Getting a Figma Token

The best way is to create one following the instructions in the Figma API Docs.

Next Steps

  • Build a CLI tool.

About

Figma prototype file to XState syntax Finite State Machine representation


Languages

Language:JavaScript 57.2%Language:TypeScript 42.8%