Animated Gradient Text
Gradient-filled text: a `bg-clip-text text-transparent` span whose three-stop linear gradient slides horizontally on a loop. Built for a short eyebrow, badge or headline fragment — never a paragraph, since the text has no solid fill to fall back to.
Preview
Rendered from the story the storybook (a11y) CI gate runs axe against — the preview can't show something that hasn't been verified.
Install
Two equivalent paths — the URL works in any shadcn-CLI setup; the alias works once you've registered @interlace in your components.json.
npx shadcn@latest add https://ds.interlace.tools/r/animated-gradient-text.jsonnpx shadcn@latest add @interlace/animated-gradient-textHistory
This component is at v1.1.0, first shipped in @interlace/ui 1.0.0. The version is stamped as a banner into the file the install writes, so the copy in your tree says which one you have — compare it with the number above before deciding whether to re-run the install.
No release note names this component yet. It shipped with the release above and has not changed since — see the full changelog for what moved elsewhere in the DS.
Import
Single named export.
import { AnimatedGradientText } from '@/components/ui/magicui/animated-gradient-text';Anatomy
Extracted from the primitive's JSDoc header. The source is the only documentation that can't drift.
AnimatedGradientText (span — .animate-gradient)
└─ children (painted through the clipped gradient)Accessibility
Every story for this component is rendered headlessly and checked with axe-core (wcag2aa, wcag22aa, best-practice, ACT) on every PR. That gate has no continue-on-error, so what ships has zero known violations.
What follows is what static analysis can see. Axe cannot press a key and never sees an overlay open, so the operable-without-a-mouse claim lives in Behavior instead, where the keyboard path is replayed step by step.
- Focus + keyboard behaviour
- Native element semantics — no interaction layer to get wrong.
- Focus ring (WCAG 2.2 SC 2.4.13)
- Not focusable — no focus indicator required.
- Reduced motion
- Animation is gated on prefers-reduced-motion.
- ARIA in the source
- None — semantics come from the element or the Base UI primitive rather than hand-written ARIA.
Examples
3 more states from the same story file.
Dependencies
- Base UI primitive
- Native / no Base UI dependency
- Lucide icons
- none
- NPM dependencies
- none
- Registry dependencies
Source
The full implementation — components/ui/magicui/animated-gradient-text.tsx once installed.
import { ComponentPropsWithoutRef } from "react"
// @interlace/animated-gradient-text v1.1.0 — Interlace design system.
// Docs, props and live preview: https://ds.interlace.tools/c/animated-gradient-text
// What changed since: https://ds.interlace.tools/c/animated-gradient-text#history
// Generated banner — keep it, the upgrade diff reads this version.
/**
* @interlace/ui — AnimatedGradientText
*
* Gradient-filled text: a `bg-clip-text text-transparent` span whose
* three-stop linear gradient slides horizontally on a loop. Built for a short
* eyebrow, badge or headline fragment — never a paragraph, since the text has
* no solid fill to fall back to.
*
* Our reimplementation of the Magic UI component of the same name. It is a
* single span plus one keyframe, so the whole effect lives in three places:
* this file, `--animate-gradient` in `styles/tokens.css`, and the `gradient`
…92 more lines…Registry JSON
The raw registry record — what the shadcn CLI fetches.