About figma-component-properties
figma-component-properties defines component property APIs and creates or configures component instances in Figma for design-system maintainers. It handles editing and setting text, boolean, instance-swap, and variant properties.
Key features
- 01Add, edit, and delete component properties
- 02Support TEXT, BOOLEAN, INSTANCE_SWAP, and VARIANT
- 03Create instances and set their properties
- 04Configure instances through variant selection
- 05Resolve property keys with suffixes
Use cases
- 01Define adjustable properties for a component set
- 02Create an instance with selected variants
- 03Update instance text or nested components
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ southleft/ figma-console-mcp-skills --skill figma-component-propertiesAfter installing, type/figma-component-propertiesin Claude Code to confirm it loaded.
Bundled filesscripts/add-property.jsscripts/instantiate-and-set.js
Details
From the project READMEfigma-component-properties — define a component's API + instantiate it
Two related jobs:
- Author the component's property API — add/edit/delete
TEXT,BOOLEAN,INSTANCE_SWAP, andVARIANTproperties so the component exposes the right knobs (the Figma equivalent of a React component's props). - Use the component — create an instance and set its properties (label text, boolean toggles, variant selection, swapped sub-instances).
Skill boundaries
use_figmarules — load the officialfigma-useskill first; it is the full Figma Plugin API reference. Essentials these scripts rely on: plain JS with top-levelawait+return(no IIFE, nofigma.closePlugin();console.logis not returned), inputs inlined asconstat the top of each script, colors in 0–1 range, load fonts before any text op,await figma.getNodeByIdAsync(...), and atomic errors (a failed script applies nothing — read the error, fix, retry).- Reading a component's existing property definitions / state machine →
use
figma-analyze-component-setorfigma-deep-component. - These are design-system authoring writes the native MCP's
get_design_context/get_metadata(read-only) do not cover.
Property types
| Type | What it controls | defaultValue | Notes |
|---|---|---|---|
TEXT | A text-layer string override | "Label" | Bind in UI to a text node's characters |
BOOLEAN | Show/hide a layer | true/false | Bind to a layer's visibility |
INSTANCE_SWAP | Which sub-component fills a slot | a component key | Pass preferredValues to populate the picker |
VARIANT | A variant axis (Size, State…) | one option string | Only meaningful on a COMPONENT_SET |
Workflow — authoring properties
- Target the COMPONENT_SET (or standalone COMPONENT). You cannot add properties to an individual variant — the script errors and tells you to use the parent set.
- Add with
scripts/add-property.js(use_figma,skillNames: "figma-component-properties"). SetNODE_ID,PROPERTY_NAME,PROPERTY_TYPE,DEFAULT_VALUE.addComponentPropertyreturns a name with a#idsuffix — capture it. - Edit / delete by reusing the same script's
editComponentProperty(name, {...})/deleteComponentProperty(name)calls (commented variants are in the script). Use the suffixed name returned at creation for edits/deletes of non-variant props. - Verify by re-reading
node.componentPropertyDefinitions(the script returns it).
Workflow — instantiate + set instance properties
- Get a component identity. A published library
componentKey(preferred) and/or a localnodeId. Pass both when you have them — the script tries the library import first, then the local node. - Run
scripts/instantiate-and-set.js. SetCOMPONENT_KEY/COMPONENT_ID, optionalVARIANT(e.g.{ Size: "md", State: "default" }),OVERRIDES,POSITION, andPARENT_ID. - Set properties on an existing instance with the same script's
setPropertiespath — it loads the main component, then matches plain names andName#id-suffixed names automatically.
Notes
- Instance property keys carry
#nodeIdsuffixes for TEXT/BOOLEAN/INSTANCE_SWAP ("Label#12:3"); VARIANT props use the bare name. The instantiate script resolves both, so you can pass the human name (Label) and it finds the suffixed key. - Direct text editing of an instance's text layer fails silently — always go through
setProperties/ instance properties, never set.characterson a nested instance text node. componentKeyonly works for published components. For local/unpublished ones usenodeId.
Comments
Markdown supported