Back to Snippets

Animated Success Checkmark SVG CSS

A confirmation panel where the circle draws itself, the tick draws in after it, then the heading and message fade up below. It all runs on load with no JavaScript.

The drawing effect is the stroke-dasharray trick. Each stroke gets a dash the same length as the path and an equal dashoffset, which hides it completely, then the animation pulls that offset to zero and the line appears to draw. The circle uses 252, which is its circumference at radius 40 rounded up.

Sequencing is done entirely with delays. Each animation shorthand carries two time values, duration first and delay second, which is how the circle waits 0.2s, the tick 0.7s, then the text 1s and 1.2s. Shifting one step means shifting the ones after it too. If you swap the tick for a different path, measure it with getTotalLength and feed that number to both the dasharray and the dashoffset.

774
#css
#svg
#checkmark
#success
#animation
#line drawing
#form
#ui