Ballmac UI home

Spinning Text

Text laid out on a circle that turns slowly, with a center slot for a logo or arrow, pausing on hover.

Installation

$ pnpm dlx shadcn@latest add @ballmac/spinning-text

Usage

import { SpinningText } from "@/components/ballmac/spinning-text"

The full example is in the Code tab above.

Examples

Sizes and direction

API reference

PropTypeDefault
text*

The words that run around the circle.

string—
separator

Shown between repeats of the text.

string" • "
duration

Seconds for one full turn.

number14
reverse

Turn counter-clockwise.

booleanfalse
pauseOnHover

Pause the spin while the pointer is over it or it has keyboard focus.

booleantrue
children

Content in the middle of the ring, such as a logo or an arrow.

React.ReactNode—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Screen readersThe ring is an image named by the text; the center slot is read normally
Reduced motionThe ring stays still

Use with AI

<SpinningText text duration reverse pauseOnHover className='size-40'>{center}</SpinningText>. The string is fitted to the circle, so shorter text spreads wider. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Spinning Text (@ballmac/spinning-text) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Scroll-down or 'new' badges
  • Decorative seals and stamps

Not for

  • Information people need to read (rotating text is hard to read)

Registry JSON: https://ui.ballmac.com/r/spinning-text.json

Credits

Free to use in personal and commercial projects.

Registry
shadcn/utils