create_vector
Create vector nodes from SVG path data or coordinate points for custom icons, chart lines, and freeform curves in Figma.
Instructions
Create a vector node from SVG path data or a list of points. Use for chart lines, custom icon paths, freeform curves, or any shape that needs path data.
Examples: // Polyline (chart trend line) create_vector({ parent: "1:23", name: "TrendLine", x: 40, y: 20, width: 550, height: 240, points: [[0,144],[90,96],[180,120],[270,64],[360,80],[450,40],[540,72]], stroke: "#6366F1", strokeWeight: 2 })
// Raw SVG path (custom shape) create_vector({ parent: "1:23", name: "Wave", width: 200, height: 60, data: "M 0 30 Q 50 0 100 30 T 200 30", stroke: "linear-gradient(90deg, #8B5CF6 0%, #F97316 100%)", strokeWeight: 1.5 })
Path input — provide ONE of: points: [[x,y], ...] compiled to "M x0 y0 L x1 y1 ..." (polyline shortcut) data: "M ... L ..." raw SVG path (LLM-native; supports M, L, C, Q, A, Z)
Stroke / fill (same formats as set_stroke / set_fill): hex "#6366F1" gradient "linear-gradient(angle, #color stop%, ...)" variable qualified bare name "$Brand/Primary"
Default fill is "transparent" so the vector shows only its stroke. Pass an explicit fill if you want it filled.
When NOT to use:
Standard rectangles / ellipses / lines — use jsx , , elements (simpler, batch-friendly)
Existing vector edits — use edit / set_stroke instead
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parent | No | Parent node ID. Omit to attach to the current page. | |
| name | No | Node name (default: "Vector"). | |
| x | No | X position relative to parent (default: 0). | |
| y | No | Y position relative to parent (default: 0). | |
| width | Yes | Vector bounds width in px. | |
| height | Yes | Vector bounds height in px. | |
| data | No | Raw SVG path string. Mutually exclusive with `points`. | |
| points | No | Polyline points as [[x,y], ...]. Compiled internally to "M x0 y0 L x1 y1 ...". Mutually exclusive with `data`. | |
| windingRule | No | Path fill winding rule (default: NONZERO). | |
| stroke | No | Stroke color — hex, gradient string, or qualified bare-name token. | |
| strokeWeight | No | Stroke weight in px (default: 1). | |
| strokeAlign | No | Stroke alignment relative to the path (default: center). | |
| fill | No | Fill — hex / gradient / variable / "transparent" (default: "transparent"). |