React AnimeJS
Components/SVG Morph2 / 25

SVG Morph

svgIntermediateRead the docs

Code

1<AnimeMorph target={targetRef} duration={800} ease="inOutQuad" alternate loop autoplay deps={[shape]}>
2 <polygon points={shapeA} />
3</AnimeMorph>

Morph between different SVG path shapes smoothly.

Live preview
SVG MorphPolygon path morphing via AnimeMorph
Props
NameTypeDefaultDescription
targetRefObject-Target polygon/path ref
durationnumber1000Morph duration in ms
easestring'inOutQuad'Easing function
alternatebooleanfalseReverse direction each iteration
loopbooleanfalseLoop the morph
depsunknown[][]Re-run when the shape changes

Related components