How to animate a whiteboard stroke reveal
Reveal the line from its start through the bend, then draw the arrowhead. Hold the finished arrow so viewers can read the direction.
Draw the bend before the arrowhead
- Draw the curved line and arrowhead as separate SVG paths. Set each path’s
pathLengthto1so the same dash values work on both paths. - Set
stroke-dasharrayto1and animatestroke-dashoffsetfrom1to0on the curved line. Start the arrowhead only after the line reaches its tip. - Keep both paths visible at the end with
forwardsfill. Let the animation play once so the completed arrow stays on screen.
Save this as arrow.html and open it in a browser. Reload to replay. With reduced motion enabled, the page shows the finished arrow without animating.
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Curved arrow stroke reveal</title>
<style>
svg { --draw: 2s; display: block; width: 100%; max-width: 360px; }
path {
stroke-dasharray: 1;
stroke-dashoffset: 1;
animation: draw var(--draw) linear forwards;
}
.head {
animation-duration: calc(var(--draw) / 4);
animation-delay: var(--draw);
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
path { animation: none; stroke-dashoffset: 0; }
}
</style>
<svg viewBox="0 0 180 100" role="img" aria-label="Curved arrow pointing right"
fill="none" stroke="currentColor" stroke-width="4">
<path pathLength="1" d="M20 80 C75 80 65 24 145 24" />
<path class="head" pathLength="1" d="M132 12 L145 24 L132 36" />
</svg>
</html>Check the stroke one frame at a time
For a frame-by-frame check, open Chromium DevTools’ Animations panel before reloading. Pause and drag the playhead in small steps. Use these times for the exercise, not as timestamps from the reference clip.
- At 0 s, neither path should be visible. Just after the start, only the left end of the curve should appear.
- At 1 s, you should see part of the curve and no arrowhead. At 2 s, the line should reach the tip; just after 2 s, the arrowhead should start to draw.
- At 2.5 s, the full arrow should be visible. Close the panel, reload and wait a few seconds to check that the arrow stays still.
Change --draw from 2s to 4s and reload. The arrowhead should now start after 4 s and finish at 5 s. If it starts too early in your own version, check that its delay equals the line’s duration.
Loretry reference
Open the Draw an Ocean Current by Hand Skill page or open the reference MP4. The SVG exercise is separate from the Loretry sample.