← Back to gallery
SVG

SVG Path Fill Reveal

A two-stage SVG pattern where a custom path outline draws first, then the matching fill reveals as a separate final phase. Demonstrated on simple production-icon shapes (heart, star, checkmark) so the technique reads at a glance.

path-filldraw-to-fillmask-revealstroke-dasharraypathLength

Draw-to-fill / PathLength

SVG Path Fill Reveal

A two-stage SVG pattern — a custom path outline draws first via stroke-dashoffset, then the matching fill reveals as a separate phase. Demonstrated on three production-icon shapes (heart, star, checkmark) so the technique reads at a glance without being buried in scene context.

Like / Favorite toggle

Like Heart

A heart contour draws first with stroke-dashoffset, then the matching gradient fill reveals — the universal like icon as a clean two-stage technique demo. Single closed cubic-Bezier path (the simplest case for the draw-to-fill mechanic).

  • like icon
  • closed Bezier
  • two-phase

Rating / Favorite toggle

Favorite Star

A 5-point star outline draws first, then the gradient fill reveals — the universal rating / favorite icon as a clean technique demo. The polygon path is computed from outer / inner radii and 36° angle steps so the geometry is mathematically exact.

  • rating icon
  • 5-point polygon
  • two-phase

Symmetric crystal / 6-fold polygon

Crystal Snowflake

A 12-point dual-radius polygon (6-fold radial — outer vertices at 60° intervals, inner notches at the half-step angles) draws and fills as a single closed path. Demonstrates the technique on a more ornamental geometry while staying within the simple "one path → one fill" boundary.

  • snowflake
  • 12-point polygon
  • 6-fold symmetry

Save / Collection toggle

Save Bookmark

A bookmark rectangle (with the classic V notch at the bottom) draws as a single closed path — straight-edge geometry contrasts with the curved heart and angular polygons. Demonstrates the technique on a path that mixes line segments and a sharp inner notch.

  • save icon
  • rect + notch
  • two-phase

Power / Notification icon

Lightning Bolt

A 7-vertex zigzag bolt draws as a single closed path with sharp angle changes. Demonstrates the technique on an asymmetric, high-contrast geometry that still shares the same outline-then-fill rhythm.

  • bolt icon
  • zigzag
  • two-phase

Verified / Confirmation toggle

Verified Check

An outer ring draws first, the inner checkmark draws inside, then both fill simultaneously with a sky-cyan gradient. Two paths sharing one cycle — demonstrates the technique on a multi-element composition while staying simple enough to read as a single icon.

  • verified icon
  • 2-path icon
  • sequential draw

Path fill inspector

Like Heart

  • like icon
  • closed Bezier
  • two-phase

A heart contour draws first with stroke-dashoffset, then the matching gradient fill reveals — the universal like icon as a clean two-stage technique demo. Single closed cubic-Bezier path (the simplest case for the draw-to-fill mechanic).

.heart-stroke {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: heart-draw 4.0s ease infinite both;
}

.heart-shape {
  opacity: 0;
  animation: heart-fill 4.0s ease infinite both;
}

@keyframes heart-draw {
  0%   { stroke-dashoffset: 1; opacity: 0; }
  6%   { opacity: 1; }
  32%  { stroke-dashoffset: 0; }
  88%, 100% { stroke-dashoffset: 0; opacity: 0.4; }
}

@keyframes heart-fill {
  0%, 28%   { opacity: 0; transform: scale(0.94); }
  48%       { opacity: 1; transform: scale(1); }
  88%       { opacity: 1; transform: scale(1); }
  98%, 100% { opacity: 0; transform: scale(0.96); }
}