Text Path

SVG text riding a curved wave, arc, or circle path on a seamless, light loop.

textpathsvgcurveheadlineanimationtypographymarquee
Text Path component preview

Overview

Text Path is a React and Tailwind CSS curved text component that runs a phrase along an SVG wave, arc, or circle as a seamless loop, in Next.js or any React app, with no dependencies. Circle mode measures the string and sizes the ring to fit, so spacing stays even with proportional fonts, while wave and arc scroll like a curved marquee. Pass any path to follow your own shape, and set speed, direction, separator, and font. It pauses off screen, stops for reduced motion, and announces the text once. Custom paths need a matching viewBox.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add text-path

Usage

Import TextPath from @/components/wensity/text-path and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import { TextPath } from "@/components/wensity/text-path";
export default function Example() {
return (
<TextPath
text="I think wensity has the best components"
curve="arc"
duration={14}
letterSpacing={0.05}
className="font-display max-w-3xl text-zinc-900 dark:text-zinc-100"
/>
);
}

Props

PropTypeDefaultDescription
textstring-The string to tile along the path.
curve"wave" | "arc" | "circle""arc"Built-in curve. Circle sizes the ring to the text; wave/arc use open path marquees. Ignored when path is set.
pathstring-Custom SVG path d. Wins over curve (open path marquee).
viewBoxstring-Custom SVG viewBox when using a custom path.
durationnumber14Seconds for one seamless loop. Lower = faster.
direction"forward" | "reverse""forward"Travel / spin direction.
separatorstring" · "Separator between tiled copies.
repeatsnumber3Tiles the string. Wave/arc: along the path. Circle: copies around the ring (radius grows to fit — no stacking).
fontSizenumber28Font size in CSS pixels.
fontWeightnumber | string500Font weight for the path text.
letterSpacingnumber0.05Letter spacing in em.
fillstringcurrentColorText fill. Omit to inherit currentColor.
showPathbooleanfalseDraw the underlying path stroke.
pathColorstringthemePath stroke color. Omit for soft theme line.
pathWidthnumber1Path stroke width in CSS pixels.
pausedboolean-Force the loop paused. When omitted, auto-pauses off-screen or when the tab is hidden.

Featured in React hero section components.