Agent skill

Figma to React Skill: Lossless Next.js Components

A rule-driven skill that turns Figma MCP output into React or Next.js components with TypeScript and Tailwind, with strict handling of positions, fonts and text heights.

Install
git clone https://github.com/majiayu000/spellbook.git
View on GitHub

Stars, license and last push from GitHub. Install count as reported by the open skills directory.

What is the figma-to-react skill?

figma-to-react is a skill in the majiayu000/spellbook library. It tells an AI coding agent to convert Figma MCP output into React or Next.js components with TypeScript and Tailwind CSS, following numbered rules on code truncation, absolute positioning, dimensions, font loading and text heights.

A header title at top 41px, not 82px, and a header line at top 100px, not 141px. Those verified positions sit in the figma-to-react skill because it exists to stop a common mistake when turning Figma MCP output into code.

The skill's own description is extracting Figma designs into production-ready React or Next.js components with TypeScript, Tailwind CSS and pixel-perfect accuracy. It is a long list of rules, each with a wrong and a correct example.

The rules, in the order the skill lists them

  1. Never truncate code. Use all of the Figma MCP output and keep every className.
  2. Flatten absolute contents wrappers. Children are already positioned absolutely, so keep their offsets and drop the parent.
  3. Extract dimensions from metadata by calling mcp__figma__get_metadata, never hardcode a frame size.
  4. Load fonts from the Google Fonts CDN link in layout.tsx instead of next/font/google, and map Figma font names to Tailwind classes.
  5. Add critical CSS to globals.css, including horizontal overflow and a .page-container that does not compress.
  6. Replace simple line images with CSS lines.
  7. Inline SVG assets.
  8. Remove fixed heights from multi-line text blocks.

Why the font and height rules matter

The skill warns that Figma weight names may not match CSS weights. Bold may need 500 or 600, and ExtraBold may need 700, so you compare against a Figma screenshot. It also fixes old names: Source Serif Pro becomes Source Serif 4.

On text, it explains that fixed heights from Figma cause overflow and different line counts, so multi-line paragraphs lose their height. Containers, single-line table rows and images keep theirs. Later rules, including table pattern detection, live in a reference file.

Who the figma-to-react skill is for

Best for

  • Developers who already have a Figma MCP server connected and want the generated React matched to the design. See Framelink Figma MCP or the free Figma MCP for ways to connect.
  • Teams building in Next.js with Tailwind, where Tailwind 4 conventions may also apply.
  • Anyone whose pages must match a fixed frame, such as 1920 by 1080, closely.

Not for

  • Projects without a Figma MCP connection, since every rule starts from its output.
  • Fluid layouts. The skill leans on absolute positioning taken from the frame, so use frontend responsive UI when the page must reflow.
  • Sites that will live in WordPress, where React output is the wrong target.

Use it with UiChemy

This skill outputs React, not WordPress. If your Figma design is headed for Elementor or Gutenberg, UiChemy's Figma to WordPress plugin converts the design directly. Click Get Started on uichemy.com to see that route.