Canvas

Canvas (canvas.originkit.dev) is a free Figma-to-code converter that turns a Figma file into production-ready markup. It reads a design through the Figma REST API using a personal access token, a file key, and an optional node id, then maps the document tree—auto layout, constraints, typography, fills, effects—onto an editable node graph rendered with @xyflow/react. Every node is keyboard operable (select, move, delete, escape) and the resulting tree is emitted to nine targets: HTML/CSS, HTML with CSS classes, React JSX, React + Tailwind, Vue, Svelte, SwiftUI, Flutter, and Jetpack Compose. Tokens and canvas state persist to localStorage, so no backend holds user credentials or design data.

Build StackNext.js (App Router), React 19, TypeScript, Tailwind CSS, @xyflow/react, Zustand, Figma REST API

Challenges

  • Mapping Figma auto layout, constraints, and absolute positioning onto layout primitives that differ per target—flexbox, SwiftUI stacks, Flutter widgets, Compose modifiers.

  • Keeping the node graph interactive as the Figma document tree grows to hundreds of nested frames.

  • Emitting readable output instead of a wall of absolutely positioned divs, including deduplicated CSS classes and sane element naming.

  • Handling Figma REST API tokens client-side without a backend, while keeping rate limits and partial fetches recoverable.

Solutions

  • Built one intermediate representation per node and one emitter per target, so adding a codegen target is a pure function over that IR instead of a fork of the traversal.

  • Rendered the tree through @xyflow/react with viewport-only rendering and memoized node components, keeping pan and zoom smooth on deep documents.

  • Collapsed repeated style sets into shared classes and carried Figma layer names through as element and component names in the generated code.

  • Kept tokens and canvas state in localStorage only, fetching per node id so a partial import can be retried without refetching the whole file.

Grateful you're here! Always happy to chat ^^

I'm open to new opportunities – full-time roles, freelance projects, and collaborations. If you're working on something interesting, I'd love to hear about it.

pilladipesh.pd@gmail.com+91 7993097879
Twitter/XLinkedIn

Designed and developed by diip3sh andredbull

Thanks to

MotionCommit MonoIconsaxCounterfeit's shapes, symbols & iconsMotion Primitives

Inspired from

Manu PaajiAna HowardJordan Jenkins

© 2026 Open source, free to use

Code
Canvas generated code output
Canvas codegen target selection