Overview
Success checkmarks draw their stroke from one endpoint to the other via stroke-dasharray + stroke-dashoffset animation, so the line physically renders in front of the user’s eyes rather than fading in. An optional ring outline completes around the check so the success state feels resolved. Three cadences ship: quick confirmation, celebratory pulse, slow editorial draw.
When to use it
Reach for the check-draw on form submission success, async-task completion, multi-step wizard final-step affordances. Skip it on background operations the user did not explicitly initiate — the draw demands attention that uninitiated completions do not deserve. Skip it for validation feedback that fires repeatedly during typing.
How it works
The SVG path defining the check has its stroke-dasharray set to the path’s own length (measured via path.getTotalLength() or hard-coded after inspection). The stroke-dashoffset starts at that same length (effectively pushing the dash off the visible path so nothing renders) and animates to zero, revealing the stroke endpoint-to-endpoint. The ring uses the same trick on a circle path. The celebratory variant adds a brief scale keyframe on the wrapper that lands synchronously with the check completion.
Production gotchas
Hard-coding the path length is fragile — any future redesign that shifts a control point silently breaks the animation (dash too long = check completes early, too short = check pauses mid-draw). Measure once at runtime with path.getTotalLength() or set both dasharray and dashoffset via JS for safety. Stroke endings depend on stroke-linecap: round on most check designs — without it the tip of the check stops flat and looks like a print error. Don’t animate stroke-dasharray itself, only stroke-dashoffset; animating both can confuse the compositor.
Accessibility
The check is decorative — pair it with a role="status" live region announcing the success message (“Saved”, “Payment complete”) so screen-reader users get the same confirmation. Set aria-hidden="true" on the SVG so it does not interrupt focus order. Under prefers-reduced-motion: reduce jump the dashoffset to zero in a single frame — the completed check still appears but without the drawing motion.
References
Implementation depth
The checkmark draw should confirm an already completed action, not delay completion. Use stroke-dashoffset for the visual trace while aria-live or visible status text communicates success immediately.
Keep the final state persistent. If the checkmark disappears too quickly, users may miss the confirmation; reduced motion should show the completed check and message without replaying the stroke animation.