Components

Aurora Text

An aurora gradient text effect for React and Tailwind CSS: soft blobs of color drift slowly through the letters like northern lights. It's a gradient clipped to real, selectable text, with props for the colors and the speed, and it holds still under reduced motion.

  • background-clip: text
  • Custom colors
  • Speed control
  • Real, selectable text
  • prefers-reduced-motion

Analytics that feel effortless

Installation

$ npx shadcn@latest add https://duskui.com/r/aurora-text.json

Usage

hero-title.tsx
import { AuroraText } from "@/components/dusk/aurora-text/aurora-text"

export function HeroTitle() {
  return (
    <h1 className="text-6xl font-bold">
      Meet the <AuroraText>night shift</AuroraText>
    </h1>
  )
}

Examples

Colors and speed

Pass two or more CSS colors in colors; each becomes a drifting blob. speed is a multiplier on the 14-second loop.

Warm palette

Cool palette

Faster drift

API Reference

Also accepts any HTML attribute for the rendered element.

PropTypeDefaultDescription
as"span" | "p" | "div" | "strong" | "em" | "h1" … "h6""span"Element to render. Use a heading level for titles.
colorsstring[][primary, sky, indigo]Aurora colors, at least two. Each becomes a soft drifting blob.
speednumber1Speed multiplier. 1 is one loop every 14 seconds.

Accessibility

  • It's one real text element, so headings stay selectable, translatable and indexable.
  • The server renders the same gradient, standing still, so there's no flash or hydration mismatch.
  • Selected text switches to the solid foreground color so it stays legible, and forced-colors modes fall back to the system text color.
  • The drift pauses off-screen and in hidden tabs. With prefers-reduced-motion the gradient holds still.
  • Check contrast: every color in the palette should be readable against your background.