Node / Images Shapes · guide
Drop shadow & stroke (ShadowOptions, StrokeOptions)
Current Apexify.js 6.0.0 documentation for Drop shadow & stroke (ShadowOptions, StrokeOptions).
Shadows and strokes are layer-level options on ImageProperties (and on groupTransform for grouped composites). They apply to bitmaps and shapes, with one shadow quirk for complex shapes.
Types ShadowOptions and StrokeOptions are exported from apexify.js (see types/common).
Shadow — shadow?: ShadowOptions
| Field | Type | Role |
|---|---|---|
color | string | Shadow colour |
gradient | gradient | Optional shadow fill as gradient |
offsetX / offsetY | number | Pixel offset from the layer |
blur | number | Blur radius |
opacity | number | Opacity multiplier where supported |
borderRadius | number | 'circular' | Rounded shadow only for the rectangular fast path |
roundedCorners | borderPosition | Which corners get borderRadius on the shadow rect |
borderPosition | borderPosition | Deprecated alias of roundedCorners |
Bitmap shadow
For images, the shadow is cast from the layout box (x, y, width, height) before the image is clipped — so borderRadius / clipPath crop the bitmap but the shadow still reads as a natural drop shadow.
Shape shadow
rectangle,circle,triangle,trapezium,polygon,arc,pieSlice,square: use the rectangular shadow (same as bitmaps) for the layout box.heartandstar: use a geometry-accurate shadow (outline-based), soborderRadiusonshadowdoes not apply the same way.
Stroke — stroke?: StrokeOptions
| Field | Type | Role |
|---|---|---|
color | string | Stroke colour |
gradient | gradient | Stroke along path with gradient |
width | number | Line width in pixels |
position | number | Inset/outset tuning (renderer-specific) |
blur | number | Extra softness on stroke |
opacity | number | Stroke opacity |
borderRadius | number | 'circular' | For box strokes (bitmaps / rect shadow box) |
borderPosition / roundedCorners | borderPosition | Which edges or corners participate (see Styling & clip) |
style | 'solid' | 'dashed' | … | Line style |
Bitmap stroke
Strokes run after the image itself, filters, and effects — see Paint order. The stroke follows the layout box (with optional rounded corners), not the alpha silhouette of the PNG.
Shape stroke
Stroke follows the real shape path (star, heart, polygon, arc, …), using the same shape fields as the fill so outline and fill stay aligned.
Known limitations (bitmaps)
If you use filterOrder: 'pre', distortion, or meshWarp, the bitmap path returns early in the implementation: stroke, effects, and post filters may not run. See Paint order for the exact table.