Node / Images Shapes · reference
Shapes — every ShapeType & ShapeProperties
Current Apexify.js 6.0.0 documentation for Shapes — every ShapeType & ShapeProperties.
Vector shapes are drawn through the same createImage pipeline as bitmaps: set source to a ShapeType string and put geometry/styling under shape?: ShapeProperties.
Quick usage
SOURCEtypescript
typescript
Required layer fields x and y always anchor the layout rectangle. Most primitives derive geometry from width / height (defaults 100 each when omitted).
Shape catalogue (ShapeType)
ShapeType | Layout box | Main shape fields |
|---|---|---|
rectangle | Full width × height | fill, color, gradient |
square | Side = min(width, height) from (x, y) | Same as rectangle |
circle | Ellipse inscribed in box | radius (defaults to min(w,h)/2), color, gradient |
triangle | Up-pointing triangle | color, gradient |
trapezium | Isosceles trapezoid | color, gradient |
star | 5-point star centred in box | outerRadius, innerRadius (optional; defaults scale from box) |
heart | Heart fitting the box | color, gradient |
polygon | Regular polygon or custom path | sides (default 6) or points |
arc | Arc / annulus sector | centerX, centerY, radius / outerRadius, innerRadius, startAngle, endAngle (radians) |
pieSlice | Same geometry path as arc | Use innerRadius: 0 for a filled wedge |
ShapeProperties reference
| Field | Applies to | Role |
|---|---|---|
fill | All | false skips fill() (outline-only useful with stroke) |
color | All | Fill colour when gradient is omitted |
gradient | All | Gradient fill (gradient type from apexify.js) |
radius | circle | Overrides automatic radius |
outerRadius / innerRadius | star, arc, pieSlice | Star tips/valleys; arc outer/inner radii |
sides | polygon (regular mode) | Number of vertices (default 6) |
points | polygon (custom mode) | { x, y }[] — canvas-absolute coordinates (see below) |
centerX / centerY | arc, pieSlice | Arc centre (default: centre of layout box) |
startAngle / endAngle | arc, pieSlice | Radians; default full turn 0 → 2π |
Important behaviour notes
staris always 5 points;shape.pointsis not used for stars.- Custom
polygon.pointsare absolute canvas coordinates — they are not interpreted as offsets fromx, y. Omitpointsto get a regular polygon centred in the layout box. arcvspieSliceshare the same implementation: withinnerRadius > 0you get an annulus sector; withinnerRadiusomitted or0, the path includes the centre (pie wedge).- Shape layers support
filters,shadow,stroke,boxBackground,borderRadius, andborderPositionfrom the parentImageProperties, but they do not use the bitmap-only featuresmask,distortion,meshWarp,clipPath,effects,filterOrder, orfilterIntensity(see Paint order). - Shadows:
heartandstaruse a shape-aware shadow path; other shapes use the rectangular shadow for the layout box.
More examples
Regular hexagon
SOURCEtypescript
typescript
Custom polygon (absolute vertices)
SOURCEtypescript
typescript
Donut arc segment
SOURCEtypescript
typescript