Skip to main content

Shape Nodes

All shape nodes extend ShapeNode which extends Node. They share the common props documented in Shapes and each adds its own specific properties.

Rect

The primary building block — a rounded rectangle that also acts as a flex/stack layout container.

<Rect
width={300}
height={200}
fill="royalblue"
borderRadius={16}
group="column"
gap={12}
padding={20}
/>
PropTypeDefault
borderRadiusnumber | { topLeft, topRight, bottomLeft, bottomRight }0
group'row' | 'column' | 'stack''row'
gapnumber | 'auto'0
alignment{ x: number, y: number }{ x: 0, y: 0 }

Ellipse

Circles, ovals, and arcs.

<Ellipse width={200} height={200} fill="tomato" />

{/* Arc */}
<Ellipse width={200} height={200} startAngle={-90} sweep={270} stroke={{ fill: 'white', weight: 6 }} />
PropTypeDefaultDescription
startAnglenumber0Starting angle in degrees
sweepnumber360Arc sweep in degrees
rationumber1Width/height ratio

Line

A polyline through an array of { x, y } points.

<Line
points={[{ x: -100, y: 50 }, { x: 0, y: -50 }, { x: 100, y: 50 }]}
stroke={{ fill: 'white', weight: 3 }}
radius={12}
closed={false}
/>
PropTypeDefaultDescription
points{ x: number, y: number }[][]Vertices
radiusnumber0Corner rounding at each vertex
closedbooleanfalseConnect last point back to first

Path

SVG path data — any d string from Illustrator, Figma, or hand-written.

<Path
d="M 0 -60 L 52 40 L -52 40 Z"
fill="mediumpurple"
/>
PropTypeDescription
dstring | PathCommand[]SVG path data

The node auto-measures its bounding box and defaults to width: 'hug', height: 'hug'.


Polygon

A regular convex polygon.

<Polygon sides={6} width={200} height={200} fill="teal" borderRadius={8} />
PropTypeDefaultDescription
sidesnumber5Number of sides
borderRadiusnumber0Corner rounding

Polygram

A star polygon. Lower ratio values produce sharper points.

<Polygram sides={5} ratio={0.4} width={240} height={240} fill="gold" borderRadius={10} />
PropTypeDefaultDescription
sidesnumber5Number of star points
rationumber0.5Inner/outer radius ratio
borderRadiusnumber0Corner rounding

Image

Renders an image file with fit modes and optional media filters.

<Image src="./photo.jpg" fit="fill" width={800} height={450} borderRadius={12} />
PropTypeDefaultDescription
srcstringImage file path
fit'fill' | 'fit' | 'crop' | 'tile'How image fills the node
borderRadiusnumber | BorderRadiusProps0Corner rounding
filtersMediaFilter[] | FilterChain[]Image filters
scalingnumberScale multiplier

Common shape props

All shape nodes inherit from ShapeNode and accept:

PropTypeDefaultDescription
fillFillProp | FillProp[][]Fill(s)
strokeStrokeProp | StrokeProp[][]Stroke(s)
shadowShadowProp | ShadowProp[][]Shadow(s)
startnumber0Draw start (0–1)
endnumber1Draw end (0–1)
clipbooleanfalseClip children to this shape

And from Node:

PropTypeDefault
xnumber0
ynumber0
widthnumber | 'fill' | 'hug''fill'
heightnumber | 'fill' | 'hug''fill'
scalenumber1
rotatenumber0
opacitynumber1
effectsEffectChain | SceneEffect[][]
paddingnumber | PaddingProps0