SVG draw-in

ng-gsap + gsap/DrawSVGPlugin

View source

DrawSVGPlugin ships free in gsap core since the Webflow acquisition, so this is a one-liner: animate drawSVG from '0%'. Registering it in the component that uses it keeps it out of everyone else's bundle.

private path = viewChild.required<ElementRef<SVGPathElement>>('path');
protected replayCount = signal(0);

// DrawSVGPlugin ships free in gsap core now — no dasharray arithmetic needed
injectGSAP(() => {
  this.replayCount(); // read so the effect re-runs on replay()
  gsap.from(this.path().nativeElement, {
    drawSVG: '0%',
    duration: 1.5,
    ease: 'power2.inOut',
  });
}, { scope: this.path });

protected replay(): void {
  this.replayCount.update((n) => n + 1);
}