Lyna
SupportBlog
IntroductionFeaturesIntegrationsTips & TricksChangelog

Figma

Import designs from Figma and turn them into working React components. The integration uses OAuth2 to access your Figma files, fetch top-level frames with thumbnails, and import them as structured data for code generation.


Connecting Figma

Open the Design Panel

In the editor, open the design panel (left sidebar) and go to the Image tab.

Authenticate via OAuth

Click Connect Figma to start the OAuth2 flow. Lyna requests two scopes:

  • file_content:read: read file content and design data.
  • file_metadata:read: read file names, thumbnails, and project structure.

Connect to Figma dialog showing the connection button and disconnected status

Browse Your Files

After connecting, navigate through your Figma team and project hierarchy to find the design you want.

Import from Figma dialog with URL input and connected status

Lyna caches Figma API responses server-side with LRU and rate limiting. If you update a design in Figma and the import shows stale data, cache diagnostic and clear endpoints are available.


How Import Works

Import from Figma dialog

  1. Lyna fetches the file and shows top-level frames with thumbnails.
  2. Select the frame or component you want.
  3. Click Import. Lyna downloads the frame as a .figma.json file plus a .png thumbnail.
  4. The AI analyzes the design data and generates React components with Tailwind CSS.

Figma import with a loaded design ready to import

What gets captured:

  • Layout: Figma auto-layout and frames become flexbox/grid CSS.
  • Typography: text styles map to Tailwind typography utilities.
  • Colors: extracted and mapped to Tailwind classes or CSS variables.
  • Spacing: padding, gaps, and margins translate to Tailwind's spacing scale.
  • Images: downloaded and included from the Figma file.

Figma-to-Chat Workflow

You can also use Figma designs as context in AI chat:

  1. Paste a Figma frame URL into the chat input.
  2. The AI fetches the design and uses it as visual reference.
  3. Ask the AI to implement it, modify it, or create variations.

Good for iterative design-to-code work where you want to discuss changes before generating code.


Supported Features

Figma FeatureLyna Output
Auto-layout (horizontal/vertical)Flexbox with Tailwind classes
Constraints and sizingResponsive width/height utilities
Text layersTailwind typography (font-size, weight, line-height)
Fill colorsbg-* and text-* classes
Borders and shadowsBorder utilities and shadow classes
Component instancesReact components with props
ImagesDownloaded and embedded as <img> tags

Limitations

  • Interactions and prototyping: prototype transitions are not imported. Add interactivity after import.
  • Complex vector graphics: intricate SVG artwork may need manual cleanup.
  • Figma plugins: plugin-generated content may not be fully supported.