Agent skill

Design to Component Translator Skill: Figma to React

In the design-to-component-translator skill's worked example, a 40px button with 12px 24px padding and a 6px radius becomes h-10, px-6 and rounded-md, with states added.

Install
git clone https://github.com/patricio0312rev/skills.git
View on GitHub

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

What is the design-to-component-translator skill?

The design-to-component-translator skill converts Figma or other design specifications into React components styled with Tailwind and shadcn patterns. It maps spacing, type and colour to tokens, adds hover, focus, active and disabled states, applies breakpoint rules and finishes with an output checklist.

The skill sits in the frontend folder of the patricio0312rev/skills repository, a collection whose README counts 155 skills. Its job is narrow: take measurements, colours and states from a design spec and write the React component that matches.

It follows an eight step workflow: analyse specs, map values to tokens, build semantic HTML, apply Tailwind or CSS, add states, handle breakpoints, add accessibility attributes and document variants.

From spec values to class names

  • A button with 40px height, 12px 24px padding, a 6px radius, Inter Medium 14px text and a #3B82F6 background becomes h-10, px-6, rounded-md, text-sm and a primary 500 colour, with hover on 600 and active on 700.
  • A card with 24px padding, a 12px radius and a 1px #E5E7EB border becomes p-6, rounded-xl and border-gray-200, with an optional stronger shadow prop.
  • A 44px form input with a 1px #D1D5DB border and an 8px radius becomes h-11, border-gray-300 and rounded-lg.
  • A 40 by 40px icon button holding a 20px icon becomes h-10, w-10 and an inner h-5, w-5 icon.

Tokens, breakpoints and states

  • A tokens.ts sample covers colours, spacing, font sizes, radii and shadows, plus a Tailwind config extension for off-scale values such as spacing 18 and a 2xs font size.
  • Artboards map to breakpoints: 375px is the default, 768px becomes md, 1024px becomes lg and 1280px becomes xl.
  • Hover is a colour step, focus uses a focus-visible ring, active darkens the fill and disabled drops opacity and pointer events.
  • Hex colours become HSL CSS variables in the shadcn style, such as primary from #3B82F6, alongside background, foreground, border, input, ring and radius.
  • Disabled designs get aria-disabled, and error designs get aria-invalid with aria-describedby.

Who the design-to-component-translator skill is for

Best for

  • React and TypeScript projects that style with Tailwind and use the cn helper and cva variants familiar from shadcn.
  • Developers handed raw Figma measurements who want repeatable token mapping. A Tailwind specific companion is gentleman-tailwind-4.
  • Design system work that needs every state and prop variant written down, alongside theming-components.

Not for

  • Stacks other than React. The examples and output are React with TypeScript.
  • Pulling data from Figma. The skill text describes no Figma connection, so pair it with a server such as gethopp-figma-mcp-bridge or paste the spec values yourself.
  • Strict fidelity. The card example adds a hover shadow that the Figma spec does not contain, and it tells you to note deviations.

Use it with UiChemy

This skill outputs React and Tailwind for an app. When the destination is WordPress, UiChemy Figma to WordPress converts the design into an editable build, and Composer lets you refine it visually inside Elementor or Gutenberg. Click Get Started on uichemy.com.