StealThis .dev

Spinning Text

Text arranged in a circle that rotates continuously using CSS transforms. Characters are positioned radially and the whole assembly spins with a smooth animation.

Open in Lab
css javascript vue svelte
Targets: TS JS HTML React Vue Svelte

Code

Spinning Text

Text characters arranged in a circle that rotates continuously. Each character is positioned using transform-origin and individual rotate transforms, while the container spins via a CSS @keyframes animation.

How it works

  1. The source string is split into individual characters.
  2. Each character is wrapped in a <span> positioned absolutely at the center of the circle.
  3. Every span is rotated by (360 / charCount) * index degrees and pushed outward with translateY(-radius).
  4. The parent element applies a continuous rotate animation.

Features

  • Configurable text — pass any string
  • Configurable radius — control circle size
  • Pure CSS animation — GPU-accelerated rotation
  • Respects reduced-motion — animation pauses when preferred