WebberUI

Curved Text Loop

Text flowing seamlessly along a custom curve, which the pointer can drag and flick with momentum.

Text flows continuously along an SVG curve, with copies automatically tiling the whole path to form a seamless loop. It can also be flicked by hand with the pointer, and keeps gliding on momentum after release.

Loading preview…
npx shadcn@latest add https://webberui.com/r/curved-text-loop.json

Playground

Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.

46
34
<CurvedTextLoop />

Installation

npx shadcn@latest add https://webberui.com/r/curved-text-loop.json

Or, once registries are configured in components.json, install it as @webberui/curved-text-loop.

Usage

import { CurvedTextLoop } from "@/components/ui/curved-text-loop";

<CurvedTextLoop text="DESIGN IN MOTION" separator="   ✦   " speed={44} />

The color comes from the surrounding text color (currentColor), and the size from fontSize (in viewBox coordinates). To swap in a different curve, pass a custom SVG path d to pathD — a circle, for example: pathD="M 320 40 A 90 90 0 1 1 319 40".

Props

PropTypeDefaultDescription
textstringThe text flowing along the curve
separatorstring" • "The separator between segments, repeated along with them
pathDstringsine waveThe d of a custom SVG path
widthnumber640viewBox width
heightnumber260viewBox height
fontSizenumber34Font size (in viewBox coordinates)
speednumber46Automatic flow speed (px/second); negative reverses, 0 stops
draggablebooleantrueWhether it can be dragged and flicked (with momentum after release)
showPathbooleanfalseShow the underlying curve as a guide
textClassNamestringApplied to the <text> to control color and weight

Accessibility

  • The SVG carries role="img" and an aria-label, so what is announced is the complete text, and the repeated visual copies are hidden from assistive technology
  • When the user has "reduce motion" enabled at the system level, the automatic flow stops and only the user's own dragging remains

On this page