figma-use
Control Figma programmatically to create frames, shapes, and components or render designs using a CLI-based workflow.
Install
mkdir -p .claude/skills/figma-use && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2471" && unzip -o skill.zip -d .claude/skills/figma-use && rm skill.zipInstalls to .claude/skills/figma-use
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Control Figma via CLI — create shapes, frames, text, components, set styles, layout, variables, export images. Use when asked to create/modify Figma designs or automate design tasks.Key capabilities
- →Create shapes, frames, text, and components in Figma via CLI
- →Set styles, layout properties, and variables for Figma nodes
- →Render JSX trees directly into Figma
- →Export Figma nodes as JSX code or Storybook stories
- →Create icons from Iconify by name
- →Watch for and react to Figma comments
How it works
The skill connects to Figma via remote debugging and executes commands or renders JSX to manipulate design elements, styles, and layouts.
Inputs & outputs
When to use figma-use
- →Automating component creation in Figma
- →Rendering UI prototypes from JSX
- →Programmatically updating design styles
- →Exporting design assets via CLI
About this skill
figma-use
CLI for Figma. Two modes: commands and JSX.
# Commands
figma-use create frame --width 400 --height 300 --fill "#FFF" --layout VERTICAL --gap 16
figma-use create icon mdi:home --size 32 --color "#3B82F6"
figma-use set fill 1:23 "$Colors/Primary"
# JSX (props directly on elements, NOT style={{}})
echo '<Frame p={24} bg="#3B82F6" rounded={12}>
<Text size={18} color="#FFF">Hello</Text>
</Frame>' | figma-use render --stdin --x 100 --y 100
Before You Start
figma-use status # Check connection
If not connected — start Figma with remote debugging:
# macOS
open -a Figma --args --remote-debugging-port=9222
# Windows
"%LOCALAPPDATA%\Figma\Figma.exe" --remote-debugging-port=9222
# Linux
figma --remote-debugging-port=9222
Figma 126+ blocks remote debugging. Run
figma-use patchonce to fix, then restart Figma. Click Always Allow on the keychain prompt. Re-run after Figma updates.Can't patch? Use
figma-use daemon start --pipe— launches Figma with debug pipe, no patching needed.
Start Figma with --remote-debugging-port=9222 and you're ready.
Non-default port? If Figma is on another port, pass
--port <N>to any command (or set theFIGMA_PORTenv var). Errors will show the correct port.open -a Figma --args --remote-debugging-port=9333 figma-use get components --port 9333
Two Modes
Imperative — single operations:
figma-use create frame --width 400 --height 300 --fill "#FFF" --radius 12
figma-use set fill <id> "#FF0000"
figma-use node move <id> --x 100 --y 200
Declarative — render JSX trees:
echo '<Frame p={24} gap={16} flex="col" bg="#FFF" rounded={12}>
<Text size={24} weight="bold" color="#000">Title</Text>
<Text size={14} color="#666">Description</Text>
</Frame>' | figma-use render --stdin --x 100 --y 200
stdin supports both pure JSX and full module syntax with imports:
import { Frame, Text, defineComponent } from 'figma-use/render'
const Button = defineComponent(
'Button',
<Frame bg="#3B82F6" p={12} rounded={6}>
<Text color="#FFF">Click</Text>
</Frame>
)
export default () => (
<Frame flex="row" gap={8}>
<Button />
<Button />
</Frame>
)
Elements: Frame, Rectangle, Ellipse, Text, Line, Star, Polygon, Vector, Group, Icon, Image, Instance
Use <Instance> to create component instances:
<Frame flex="row" gap={8}>
<Instance component="59763:10626" />
<Instance component="59763:10629" />
</Frame>
⚠️ Always use --x and --y to position renders. Don't stack everything at (0, 0).
Icons
150k+ icons from Iconify by name:
figma-use create icon mdi:home
figma-use create icon lucide:star --size 48 --color "#F59E0B"
figma-use create icon heroicons:bell-solid --component # as Figma component
In JSX:
<Icon name="mdi:home" size={24} color="#3B82F6" />
Images
Load images from URL:
<Image src="https://example.com/photo.jpg" w={200} h={150} />
Export JSX
Convert Figma nodes back to JSX code:
figma-use export jsx <id> # Minified
figma-use export jsx <id> --pretty # Formatted
# Format options
figma-use export jsx <id> --pretty --semi --tabs
# Match vector shapes to Iconify icons (requires: npm i whaticon)
figma-use export jsx <id> --match-icons
figma-use export jsx <id> --match-icons --icon-threshold 0.85 --prefer-icons lucide,tabler
Round-trip workflow:
# Export → edit → re-render
figma-use export jsx <id> --pretty > component.tsx
# ... edit the file ...
figma-use render component.tsx --x 500 --y 0
Compare two nodes as JSX:
figma-use diff jsx <from-id> <to-id>
Export Storybook (Experimental)
Export all components on current page as Storybook stories:
figma-use export storybook # Output to ./stories/
figma-use export storybook --out ./src/stories # Custom output dir
figma-use export storybook --match-icons # Match vectors to Iconify icons
figma-use export storybook --no-semantic-html # Disable semantic HTML conversion
Semantic HTML: By default, components are converted to semantic HTML elements based on their names:
Input/*,TextField/*→<input type="text">Textarea/*→<textarea>Checkbox/*→<input type="checkbox">Radio/*→<input type="radio">Button/*→<button>Select/*,Dropdown/*→<select>
Use --no-semantic-html to disable this and keep <Frame> elements.
Generates .stories.tsx files:
- ComponentSets → React component with props + stories with args
- VARIANT properties → Union type props (
variant?: 'Primary' | 'Secondary') - TEXT properties → Editable string props (
label?: string) - Components grouped by
/prefix →Button/Primary,Button/Secondary→Button.stories.tsx
Example output for Button with variant and label:
// Button.tsx
export interface ButtonProps {
label?: string
variant?: 'Primary' | 'Secondary'
}
export function Button({ label, variant }: ButtonProps) {
if (variant === 'Primary')
return (
<Frame>
<Text>{label}</Text>
</Frame>
)
// ...
}
// Button.stories.tsx
export const Primary: StoryObj<typeof Button> = {
args: { label: 'Click', variant: 'Primary' }
}
Variables as Tokens
Reference Figma variables in any color option with var:Name or $Name:
figma-use create rect --width 100 --height 100 --fill 'var:Colors/Primary'
figma-use set fill <id> '$Brand/Accent'
In JSX:
<Frame bg="$Colors/Primary" />
<Text color="var:Text/Primary">Hello</Text>
Style Shorthands
Size & Position:
| Short | Full | Values |
|---|---|---|
w, h | width, height | number or "fill" |
minW, maxW | minWidth, maxWidth | number |
minH, maxH | minHeight, maxHeight | number |
x, y | position | number |
Layout:
| Short | Full | Values |
|---|---|---|
flex | flexDirection | "row", "col" |
gap | spacing | number |
wrap | layoutWrap | true |
justify | justifyContent | "start", "center", "end", "between" |
items | alignItems | "start", "center", "end" |
p, px, py | padding | number |
pt, pr, pb, pl | padding sides | number |
position | layoutPositioning | "absolute" |
grow | layoutGrow | number |
stretch | layoutAlign | true → STRETCH |
Appearance:
| Short | Full | Values |
|---|---|---|
bg | fill | hex or $Variable |
stroke | strokeColor | hex |
strokeWidth | strokeWeight | number |
strokeAlign | strokeAlign | "inside", "outside" |
opacity | opacity | 0..1 |
blendMode | blendMode | "multiply", etc. |
Corners:
| Short | Full | Values |
|---|---|---|
rounded | cornerRadius | number |
roundedTL/TR/BL/BR | individual corners | number |
cornerSmoothing | squircle smoothing | 0..1 (iOS style) |
Effects:
| Short | Full | Values |
|---|---|---|
shadow | dropShadow | "0px 4px 8px rgba(0,0,0,0.25)" |
blur | layerBlur | number |
overflow | clipsContent | "hidden" |
rotate | rotation | degrees |
Text:
| Short | Full | Values |
|---|---|---|
size | fontSize | number |
weight | fontWeight | "bold", number |
font | fontFamily | string |
color | textColor | hex |
Grid (CSS Grid layout):
| Short | Full | Values |
|---|---|---|
display | layoutMode | "grid" |
cols | gridTemplateColumns | "100px 1fr auto" |
rows | gridTemplateRows | "auto auto" |
colGap | columnGap | number |
rowGap | rowGap | number |
Components (via .figma.tsx)
First call creates master, rest create instances:
import { defineComponent, Frame, Text } from 'figma-use/render'
const Card = defineComponent(
'Card',
<Frame p={24} bg="#FFF" rounded={12}>
<Text size={18} color="#000">
Card
</Text>
</Frame>
)
export default () => (
<Frame gap={16} flex="row">
<Card />
<Card />
</Frame>
)
figma-use render ./Card.figma.tsx --x 100 --y 200
figma-use render --examples # Full API reference
Variants (ComponentSet)
import { defineComponentSet, Frame, Text } from 'figma-use/render'
const Button = defineComponentSet(
'Button',
{
variant: ['Primary', 'Secondary'] as const,
size: ['Small', 'Large'] as const
},
({ variant, size }) => (
<Frame
p={size === 'Large' ? 16 : 8}
bg={variant === 'Primary' ? '#3B82F6' : '#E5E7EB'}
rounded={8}
>
<Text color={variant === 'Primary' ? '#FFF' : '#111'}>
{variant} {size}
</Text>
</Frame>
)
)
Creates real ComponentSet with all combinations.
Diffs
Compare frames and generate patch:
figma-use diff create --from <id1> --to <id2>
--- /Card/Header #123:457
+++ /Card/Header #789:013
type: FRAME
size: 200 50
-fill: #FFFFFF
+fill: #F0F0F0
⚠️ Context lines need space prefix: size: 200 50 not size: 200 50
Apply with validation:
figma-use diff apply patch.diff # Fails if old values don't match
figma-use diff apply patch.diff --dry-run # Preview
figma-use diff apply patch.diff --force # Skip validation
Visual diff (red = changed pixels):
figma-use diff visual --from <id1> --to <id2> --output diff.png
⚠️ After initial render, use diffs or direct commands. Don't re-render full JSX trees.
Query (XPath)
Find nodes using XPath selectors:
figma-use query "//FRAME" # All frames
figma-use query "//FRAME[@width < 300]" # Frames narrower than 300px
figma-use query "//COMPONENT[starts-with(@name, 'Button')]" # Name starts with
figma-use query "//FRAME[contains(@name, 'Card')]" # Name contains
figma-use query "//SECTION/FRAME"
---
*Content truncated.*
Prerequisites
Limitations
- →Deleting a section deletes all its children.
- →Row layout needs explicit width.
- →Figma 126+ blocks remote debugging without a patch.
How it compares
This skill enables programmatic control of Figma through CLI commands and JSX, offering an automated and code-driven approach to design compared to manual interaction within the Figma UI.
Compared to similar skills
figma-use side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| figma-use (this skill) | 9 | 3mo | Review | Advanced |
| penpot-uiux-design | 27 | 6mo | Review | Advanced |
| elegant-design | 21 | 5mo | Review | Intermediate |
| visual-design-foundations | 5 | 5mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
penpot-uiux-design
github
Comprehensive guide for creating professional UI/UX designs in Penpot using MCP tools. Use this skill when: (1) Creating new UI/UX designs for web, mobile, or desktop applications, (2) Building design systems with components and tokens, (3) Designing dashboards, forms, navigation, or landing pages, (4) Applying accessibility standards and best practices, (5) Following platform guidelines (iOS, Android, Material Design), (6) Reviewing or improving existing Penpot designs for usability. Triggers: "design a UI", "create interface", "build layout", "design dashboard", "create form", "design landing page", "make it accessible", "design system", "component library".
elegant-design
rand
Create world-class, accessible, responsive interfaces with sophisticated interactive elements including chat, terminals, code display, and streaming content. Use when building user interfaces that need professional polish and developer-focused features.
visual-design-foundations
wshobson
Apply typography, color theory, spacing systems, and iconography principles to create cohesive visual designs. Use when establishing design tokens, building style guides, or improving visual hierarchy and consistency.
frontend-design-pro
claudekit
Creates jaw-dropping, production-ready frontend interfaces AND delivers perfectly matched real photos (Unsplash/Pexels direct links) OR flawless custom image-generation prompts for hero images, backgrounds, and illustrations. Zero AI slop, zero fake URLs.
design-context
WellApp-ai
Refresh UI/UX context from design system, Storybook, and codebase
vibefigma
vibeflowing-inc
Convert Figma designs to production-ready React components with Tailwind CSS. Use when user provides a Figma URL, asks to convert Figma designs to React/code, wants to extract components from Figma, or mentions "vibefigma". Requires a Figma access token (via --token flag, FIGMA_TOKEN env var, or .env file).