Capítulo 233 de 411
Progressively reveals or hides the stroke of an SVG shape (path, line, polyline, polygon, rect, ellipse) by animating stroke-dashoffset/stroke-dasharray under the hood, and can draw from the middle outward or any custom segment.
drawSVG value is a two-part range (like "20% 80%") describing which portion of the stroke is currently visible, not the animation's start/end percentages.drawSVG value describes the target end state (or the start state for a from() tween) — it does not itself animate between two percentages you specify.gsap.registerPlugin(DrawSVGPlugin);
// draws all ".draw-me" elements from invisible to fully drawn
gsap.from(".draw-me", { duration: 1, drawSVG: 0 });
// draw outward from the middle to fill the whole path
gsap.fromTo("#path", { drawSVG: "50% 50%" }, { duration: 1, drawSVG: "0% 100%" });
drawSVG: 0 → full) and drawing outward from a custom starting segment.