Command Palette
Search for a command to run

Text Along Path

Render animated text that loops or tracks scroll progress along any SVG path.

motion-sv
JOIN THE WAITLIST ✉ JOIN THE WAITLIST ✉ JOIN THE WAITLIST ✉ JOIN THE WAITLIST ✉ JOIN THE WAITLIST ✉ JOIN THE WAITLIST ✉JOIN THE WAITLIST ✉JOIN BROTHER JOIN THE WAITLIST ✉ JOIN THE WAITLIST ✉ JOIN THE WAITLIST ✉ JOIN THE WAITLIST ✉ JOIN THE WAITLIST ✉ JOIN THE WAITLIST ✉JOIN THE WAITLIST ✉JOIN BROTHER

Installation

pnpm dlx shadcn-svelte@latest add http://sveltekit-prerender/f/text-along-path.json
Visit Original Docs

For more deeper understaing visit fancy components documentation.

Examples

Auto Animation

PARIS • LONDON • BERLIN • ROME • BARCELONA • MADRID • VIENNA • PRAGUE • AMSTERDAM • STOCKHOLM PARIS • LONDON • BERLIN • ROME • BARCELONA • MADRID • VIENNA • PRAGUE • AMSTERDAM • STOCKHOLM BUDAPEST • COPENHAGEN • OSLO • HELSINKI • MILAN • MUNICH • VENICE • MADRID • VIENNA • PRAGUE BUDAPEST • COPENHAGEN • OSLO • HELSINKI • MILAN • MUNICH • VENICE • MADRID • VIENNA • PRAGUE PARIS • BERLIN • ROME • BARCELONA • MADRID • VIENNA • PRAGUE • AMSTERDAM PARIS • BERLIN • ROME • BARCELONA • MADRID • VIENNA • PRAGUE • AMSTERDAM

Animation on closed path

loading loading loading loading loading loading loading loading

Scroll-driven animation

SCROLL DOWN

Information is expanding daily. How to get it out visually is important. The details are not the details. They make the design. There's no other product that changes function like the computer. Innovation is the outcome of a habit, not a random act. The only important thing about design is how it relates to people. Good design is obvious. Great design is transparent.

Props

PropTypeDefaultDescription
pathstringrequiredSVG path data string used as the motion track for the text.
textstringrequiredText content rendered along the path.
pathIdstringauto-generatedOptional id used to link the `<path>` and `<textPath>` nodes.
pathClassstringundefinedClasses applied to the underlying SVG path element.
preserveAspectRatioPreserveAspectRatio"xMidYMid meet"SVG preserveAspectRatio value forwarded to the root element.
showPathbooleanfalseDisplays the underlying guide path using the current text color.
widthstring | number"100%"Width forwarded to the root SVG element.
heightstring | number"100%"Height forwarded to the root SVG element.
viewBoxstring"0 0 100 100"SVG viewBox used to size and scale the path scene.
svgClassstringundefinedClasses applied to the root SVG element.
textClassstringundefinedClasses applied to each `<textPath>` instance.
textAnchor"start" | "middle" | "end""start"Anchor alignment used for the rendered SVG text.
animationType"auto" | "scroll""auto"Uses SVG `<animate>` loops in `auto` mode or maps scroll progress to `startOffset` in `scroll` mode.
durationnumber4Duration in seconds for the automatic looping animation.
repeatCountnumber | "indefinite""indefinite"Repeat count forwarded to the SVG animate elements in auto mode.
easingFunction{ calcMode?: string; keyTimes?: string; keySplines?: string }{}Optional SVG animation timing settings forwarded to both auto animation tracks.
scrollContainerHTMLElement | nullundefinedOptional scroll container observed when `animationType` is `scroll`.
scrollOffsetUseScrollOptions["offset"]["start end", "end end"]Offset pair used by `motion-sv` when tracking scroll progress.
scrollTransformValues[number, number][0, 100]Maps scroll progress to the text path start offset percentage range.