set_stroke
Set stroke (border) on Figma nodes with customizable color, weight, alignment, and batch support. Supports hex, gradients, and variable tokens.
Instructions
Set stroke (border) on a node.
set_stroke({node: "1:2", stroke: "1 #E0E0E0"}) set_stroke({node: "1:2", stroke: "2 #333 inside"}) set_stroke({node: "1:2", color: "#E0E0E0", weight: 1, align: "inside"}) set_stroke({node: "1:2", color: "linear-gradient(90deg, #8B5CF6 0%, #F97316 100%)", weight: 1.5, align: "inside"})
// Batch — bulk stroke update in one call: set_stroke({nodes: [{node: "1:2", color: "#E0E0E0", weight: 1}, {node: "1:3", color: "#333", weight: 2}]})
Shorthand: "weight color align" (e.g. "1 #E0E0E0 inside"). Hex only in shorthand.
Accepted color formats (for the explicit color field, not the shorthand):
hex "#E0E0E0"
gradient string CSS-like subset (see set_fill description for full grammar — same rules).
Common: "linear-gradient(deg, <#hex> %, ...)", "radial-gradient()".
Rejected: "circle at X% Y%", named colors, hsl().
variable token qualified bare name "$Border/Default"
To bind a variable to the stroke color, use the explicit color field — the shorthand parser silently drops bare-name tokens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node | No | Node ID (single mode) | |
| stroke | No | Shorthand: "1 #E0E0E0 inside" — single-string form. Hex only; for gradient/variable use the explicit color field. | |
| color | No | Stroke color — hex, gradient string, or qualified bare-name token | |
| weight | No | Stroke weight in px | |
| align | No | Stroke alignment relative to the frame edge | |
| nodes | No | Batch: [{node, color?, weight?, align?, stroke?}] |