webdevpuneet.com

Related Snippets

44 in Text Animations category
28–33 of 44

Aurora Text — Free HTML CSS Animated Gradient Text Snippet

Aurora Text · Text Animation · Plain HTML, CSS & JS · Live preview

Copy & paste

Source Code

<div class="at-stage">
  <p class="at-eyebrow">Northern lights</p>
  <h1 class="at-text">Aurora</h1>
  <p class="at-sub">A flowing aurora gradient drifts through the letters — clipped to the text, animated forever.</p>
</div>

Extend with AI

Take This Snippet Further With AI

The AI prompt for this one is for Patreon supporters ($3 a month), along with a site with no ads. Supporters enter the passcode once and it is remembered in this browser.

· Become a supporter

What's included

Features

Gradient clipped to text
Color lives inside the glyph shapes.
Flowing drift
background-position eases back and forth.
Aurora palette
Cool teals and greens with a violet accent.
Ambient glow
A soft drop-shadow around the type.
Multi-line friendly
Follows the exact letter contours.
Reduced-motion safe
Static gradient when motion is reduced.
Runtime recolor API
Rebuild the gradient from any palette.
Compositor-cheap
One property animates on one element.

About this UI Snippet

Aurora Text — A Flowing Aurora Gradient Inside the Letters

Screenshot of the Aurora Text snippet rendered live

Aurora text fills a headline with a slowly flowing, multi-color gradient — teal, green, and violet drifting through the letters like the northern lights — clipped to the glyph shapes so the color lives inside the type. This snippet builds it with pure CSS, plus a couple of optional JavaScript lines for accessibility and runtime recoloring.

A gradient clipped to the glyphs

The text color is set to transparent and filled with a linear-gradient via background-clip: text, so the gradient shows only through the letter shapes. The gradient repeats its aurora colors and is sized at 200% so there is room to move it around. Clipping to text means the color automatically follows the exact contours of the glyphs — including counters and serifs — across any number of lines, without masks or extra elements.

The flowing animation

The atFlow keyframe animates background-position from 0% 50% to 100% 50% and back on an 8-second ease-in-out loop. Because the gradient is larger than the text and its color stops repeat, sliding the position drifts the bands of color slowly through the letters, never quite repeating — the gentle, organic shimmer of an aurora. The ease-in-out (rather than linear) gives it a breathing, tidal quality instead of a constant scroll. A soft green drop-shadow adds an ambient glow around the type.

Why this looks like an aurora, not a rainbow

The palette and motion are deliberately restrained: cool teals and greens with a single violet accent, drifting slowly. That cool, limited palette plus the slow ease is what evokes the northern lights specifically, versus a fast, saturated rainbow which reads as generic. Swapping the colors changes the mood entirely while keeping the same mechanic.

Accessibility and runtime control

The animation is pure CSS, but the script checks prefers-reduced-motion and disables it for users who request less motion — the text still shows the gradient, just static. A tiny window.auroraText.colors([...]) helper rebuilds the flowing gradient from any list of CSS colors at runtime (it appends the first color to the end so the loop stays seamless), handy for theming or letting users pick a palette. Neither script is required for the core effect.

Performance

Only background-position animates, on a single element, which the browser composites cheaply — so even a giant headline shimmers smoothly. There is no canvas, no SVG, and no per-frame JavaScript.

Customizing it

Change the gradient colors and angle for a different aurora (or a warm sunset, or a metallic sheen), adjust the background-size and keyframe range to control how far the bands travel, retime the loop for a faster or calmer flow, or tune the drop-shadow glow. Provide a solid fallback color for contexts where background-clip: text is unsupported. Pair it with a retro grid or particle network backdrop for a striking hero.

Step by step

How to Use

  1. 1
    Paste HTML, CSS, and JSA large headline fills with a flowing aurora gradient.
  2. 2
    Watch the flowBands of teal, green, and violet drift through the letters.
  3. 3
    Note the glowA soft drop-shadow halos the type.
  4. 4
    Recolor at runtimeCall window.auroraText.colors([...]) with your palette.
  5. 5
    Check reduced motionEnable the OS setting and the flow stops.
  6. 6
    Retime the loopAdjust the keyframe duration and gradient size.

Real-world uses

Common Use Cases

Aurora hero titles
Shine a flowing teal, green and violet gradient through a title over a particle network backdrop.
Brand wordmarks
Animate a logotype on a landing page, with the gradient clipped to the glyphs so the colour lives inside the letters.
Feature section lead-ins
Lead into a feature tabs showcase with a title whose background-position eases gently back and forth across the letters.
Launch page headings
Pair with a retro grid hero for an aurora-meets-synthwave opening, with a soft drop-shadow adding ambient glow.
Gradient text alternatives
Offer a flowing option beside the static gradient text for creative portfolios, brand pages and any headline that deserves motion.
Related: Canvas ASCII Art Converter
See the Canvas ASCII Art Converter for a related animations pattern worth pairing with this one.
Related: Elastic Spring Toggle Switch
See the Elastic Spring Toggle Switch for a related animations pattern worth pairing with this one.

Got questions?

Frequently Asked Questions

The text color is set to transparent and filled with a linear-gradient via background-clip: text, so the gradient only shows through the glyph shapes. It automatically follows the exact contours of the letters, including counters, across multiple lines, with no masks or extra elements.

The gradient is sized at 200% so it is larger than the text, and the atFlow keyframe animates background-position back and forth on an 8-second ease-in-out loop. Because the color stops repeat and the gradient is oversized, the bands of color drift slowly through the letters without an obvious seam, giving the aurora shimmer.

The palette and motion are restrained: cool teals and greens with a single violet accent, drifting slowly on an ease-in-out curve. That limited, cool palette plus the tidal motion evokes the northern lights, whereas a fast, fully-saturated rainbow reads as a generic gradient. Swapping colors changes the mood while keeping the mechanic.

The script checks prefers-reduced-motion and disables the animation when set, so the text still shows the gradient but does not move for users who want less motion. Provide a solid fallback color too, since background-clip: text needs the text to be transparent and is unsupported in a few old contexts.

Make a small component that applies the class to its children, read prefers-reduced-motion in a mount effect to disable the animation when requested, and expose a colors prop that sets the gradient via inline style. The effect is pure CSS. In Tailwind, define the flow keyframe in the config and use bg-clip-text with text-transparent and an arbitrary gradient image.

Design your website