cnippet/ui
  1. motion
  2. text animations
  3. text along path

text animations

Text Along Path

Text follows a custom SVG path — continuously looping in auto mode or scrubbing with scroll. Supports any SVG path shape and exposes the path stroke for visual debugging.

Installation

Usage

Anatomy

Good to know

  • path is an SVG path (d attribute) in the coordinates of viewBox. Set showPath while designing to see it.
  • animationType="auto" moves the text along the path on a loop (duration in seconds). "scroll" moves it as the page scrolls; pass scrollContainer to use another scrolling element.
  • The text is real SVG text, so screen readers can read it.
  • When the user has turned on reduced motion, the auto loop is turned off and the text stays at the start of the path. The scroll mode still follows the scroll position, because the user drives it.

Props

Examples

Circular Badge

Text loops continuously around a circular path — classic badge or stamp design. Repeat the text with a bullet separator so the loop is seamless.

Wave Path

Text flows along a sinusoidal wave with animationType="auto". Adjust Q control points to steepen or flatten the wave.

Curved Path with Visible Stroke

A cubic Bézier curve with showPath={true} reveals the guide path in a muted colour — useful during design to position text before hiding the stroke.