Spinning Text
Text laid out on a rotating circle with an accessible name and pause on hover.
pnpm dlx @glinui/cli@latest add spinning-textOwn every component
Hover the seal to pause it.
Installation
pnpm dlx @glinui/cli@latest add spinning-textCredits. Adapted from Motion Primitives (MIT, (c) 2024 ibelick). motion/react removed (CSS and Web Animations API), tokens, accessibility, reduced motion levels, RTL Attribution details.
Prefer the package?
Usage
Improvement over the original: pause on hover or focus, pause offscreen and in hidden tabs, static ring at motion none, no inline style attributes.
End the string with a separator and a space so the loop reads as a ring: `"open source * made to be owned * "`.
Variants
Type treatments.
<SpinningText variant="glass">{"glass * glass * "}</SpinningText>States
Speed, direction and ring size.
<SpinningText duration={6} reverse radius={4} fontSize={0.7}>...</SpinningText>In a layout
A verified badge beside a proof point.
Trusted by teams
A rotating badge beside a proof point.
<Card className="flex items-center gap-5"> <SpinningText>{"verified * "}</SpinningText> <p>Trusted by teams</p></Card>Accessibility
- The wrapper is `role="img"` with `aria-label` set to the full string; the individual glyphs are `aria-hidden`.
- Decorative by default. Pair it with a visible heading if the text carries meaning.
- Never traps focus or intercepts pointer events beyond the optional hover pause.
ARIA Attributes
- `role="img"` with `aria-label`
- `aria-hidden="true"` on the glyph ring
Reduced Motion
The ring only turns at motion level full. Under motion none or prefers-reduced-motion the component renders its static frame. Glyphs stay placed on the circle.
Affected properties
ring rotationAPI Reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
children | string | Yes | - | Text laid out on the ring. It is also the accessible name. |
variant | "default" | "plain" | "glass" | No | default | Type treatment. |
duration | number | No | 10 | Seconds per full turn. |
reverse | boolean | No | false | Spin counter-clockwise (mirrored in RTL). |
fontSize | number | No | 1 | Glyph size in rem. |
radius | number | No | 5 | Ring radius in ch units. |
pauseOnHover | boolean | No | false | Pause while hovered or focused within. |
Source
Import directly from the package or browse the source on GitHub. Click any file to view it.
Import
import { SpinningText } from "@glinui/ui"Dependencies
@glinui/ui@glinui/motionclass-variance-authorityGenerated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/spinning-text.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata
Primary Props Type
SpinningTextProps
SpinningTextProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
children | string | Yes | - | The string laid out on the ring. It becomes the accessible name. |
duration | number | No | 10 | Seconds per full turn. |
fontSize | number | No | 1 | Glyph size in rem. |
pauseOnHover | boolean | No | false | Pause the rotation while hovered or focused within. |
radius | number | No | 5 | Ring radius in ch units. |
reverse | boolean | No | false | Spin counter-clockwise. In RTL documents the default direction is mirrored. |
variant | "default" | "plain" | "glass" | No | "default" | Variant option from spinningTextVariants. |