Six input types, one schema
text, number, slider, boolean, select, color — all declared in a plain JS object. Your IDE knows the shape. Validation catches mistakes before they hit canvas.
Read docsBlock wraps design-system components with typed controls, direct canvas writes, and clear ownership rules so teams can edit components without digging through variants. It is a practical first step toward AI-ready design systems: pixels coupled with explicit logic.
One schema for text, booleans, variants, sliders, colors, and repeatable content.
// Define your Block here.// Add inputs inside `inputs`, then add `bind()` only when you need it.// Tip: use Cmd/Ctrl+Enter to preview and Cmd/Ctrl+S to save.block.define({inputs: {scores: {type: "collection",label: "Scores",blockKey: "score",view: "table",default: [],write(node, value) {node.findOne("_content").setBlockValues(value)},initial(node) {const blockData = node.findOne("_content").getBlockValues()return blockData},},},// bind(inputs, node) {// // Keep component-wide behavior here.// },});
Define text, boolean, select, slider, and color inputs in plain JS. Your team sets values in a clean panel — no scrolling through nested variant combinations.
Each input owns a canvas target. write() pushes every change instantly. initial() reads the current state when the editor opens — start from where the design already is.
Typed inputs turn visual choices into structured component state. That does not make the plugin agent-operated today, but it creates the contract future automation can rely on.
A structured API that gives every Figma component a clear logic layer your team can use today, with clearer state for future AI workflows.
Read the API docsInputs editors can touch
Defines inputs, writes, and bindings
The source components and variants
text, number, slider, boolean, select, color — all declared in a plain JS object. Your IDE knows the shape. Validation catches mistakes before they hit canvas.
Read docswrite() fires on every input change and pushes the value to exactly the Figma layer it owns. One input, one target — no branching, no side effects.
Read docsinitial() reads current Figma state when the editor opens — so the panel always reflects the real component, not a stale default.
Read docsbind(inputs, node) runs after every change. Use it for conditional visibility, computed strings, and layout updates that depend on two or more inputs together.
Read docsBlock validates that no two inputs write to the same canvas target. Conflicting writers are flagged before the definition compiles — not discovered at runtime.
Read docsTraverse, read, and write Figma layers inside any handler. findChild, setText, setProperty, setVisible, setFill — the full surface lives on every node.
Read docs One block.define() call is enough to wrap the first component, connect pixels to logic, and make its intent visible.