Playground
Change the props and copy the code. The controls come from the component's TypeScript types.
Props
size160
duration14
import { SpinningText } from "@/components/ui/spinning-text";<SpinningText text="synccn • components • " />Installation
$ pnpm dlx shadcn@latest add @synccn/spinning-textFirst time in this project? Connect synccn with one command.
Usage
import { SpinningText } from "@/components/ui/spinning-text";<SpinningText text="scroll to explore • " />API reference
Generated from the component's TypeScript types, so it always matches the code.
SpinningText
Text set around a circle that slowly rotates. Put an icon or logo in the middle via children.
PropTypeDescription
- textrequired
stringText around the circle; end with a separator so it loops neatly.
- size
numberDefault
160Diameter in pixels.
- duration
numberDefault
14Seconds per rotation.
- reverse
booleanDefault
falseRotate anticlockwise.
- className
stringExtra classes for the root element.
- children
React.ReactNodeContent to render.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA roles: img
- ARIA attributes: aria-label
- Respects the reduced motion setting
More motion
MarqueeEndless scrolling row or column that pauses on hover.Number TickerCounts up to a number when it scrolls into view.TypewriterTypes and deletes a list of phrases.Shimmer TextA light sweep across text for loading moments.Word RotateCycles words with a vertical slide.Text ScrambleCharacters scramble and resolve left to right.