Animates the stroke of an SVG element, like drawing a line.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sveltejs/svelte/llms.txt
Use this file to discover all available pages before exploring further.
in transitions begin with the path invisible and draw the path to the screen over time. out transitions start in a visible state and gradually erase the path.
The draw transition only works with elements that have a getTotalLength method, such as <path> and <polyline>.
Usage
Parameters
Milliseconds before starting the transition
Duration of the transition in milliseconds, or a function that takes the path length and returns a duration. If neither
duration nor speed is specified, defaults to 800msThe speed of the animation in pixels per millisecond. If specified, the duration will be calculated as
length / speed. Cannot be used together with durationAn easing function that controls the animation curve
Example with parameters
Notes
The animation uses the SVGstroke-dasharray and stroke-dashoffset properties to create the drawing effect. If the element has stroke-linecap set to anything other than butt, the stroke width is added to the path length to ensure smooth animation.