Spinning Text Component

The SpinningText component is a dynamic and visually engaging UI element that animates text in a circular spinning motion. It is highly customizable, allowing you to control the animation's speed, direction, radius, and more.

Features

  • Circular Animation: Spins text in a circular path for a unique visual effect.
  • Customizable Speed: Control the animation duration with the duration prop.
  • Reverse Animation: Easily reverse the spinning direction using the reverse prop.
  • Flexible Styling: Customize the font size, radius, and additional styles via props.
  • Accessible: Includes a screen-reader-friendly version of the text for better accessibility.
  • Lightweight: Built with motion for smooth animations and optimized performance.
This is example text!

Playground

Adjust speed, radius, and direction live.

This is example text!
Controls
Controls

Installation

Usage

Props

PropertyTypeDefaultDescription
childrenstring | string[]requiredThe text content to be animated. Can be a single string or an array of strings.
styleCSSPropertiesCustom styles for the container.
durationnumber10Duration of the spinning animation in seconds.
classNamestringAdditional CSS classes for the container.
reversebooleanfalseReverses the spinning direction when set to `true`.
radiusnumber5Radius of the circular path in `ch` units.
transitionTransitionCustom transition settings for the animation. Merges with the default transition.
variants{ container?: Variants; item?: Variants; }Custom animation variants for the container and individual characters.