✳ Web Tattva Labs← Back to Labs

SVG Motion Along a Path.

Use the declarative animateMotion element to move and orient an SVG marker along a curve.

View code
<svg class="route" viewBox="0 0 280 150" aria-label="Animated path" role="img"><path d="M20 102 C60 9 99 11 133 69 S215 140 260 50" fill="none" stroke="currentColor" stroke-width="2" stroke-dasharray="4 6" opacity=".48"/><path d="M-9-6 10 0-9 6Z" fill="currentColor">
  <animateMotion path="M20 102 C60 9 99 11 133 69 S215 140 260 50" dur="3s" rotate="auto" repeatCount="indefinite"/>
</path></svg>

Technique reference ↗