Presets

CSS animation glow (neon text)

Text that breathes with a neon glow, its light swelling and fading in a slow pulse.

CSSTailwindReactGIFMP4
trigger: loop
NEON
00.000 / 3.600s
timing
style
content
16 max

npm i motion · the component uses motion/react

How it works

This CSS glow animation makes a word look like a neon sign that breathes: the light around the letters swells, then dims, then swells again. The text itself is near-white (#fbfff0) in bold with wide letter spacing, which is how neon tubes look when they are lit; the color comes from the glow, not from the text.

The glow is a two-layer text-shadow. The glow keyframe goes from a tight 20% and a wider 50% layer at reduced opacity to 40% and 100% of Glow size at full strength. Animation-direction alternate plays it forward and back, and the default sine-in-out easing keeps the swell smooth at both ends, so you get a slow pulse without a visible reset.

Use it for headlines on dark landing pages, event or nightlife sites, game menus and "live" banners. Parameters: Text, Glow color, Font size, Glow size, Duration and Easing. Glow size around half of Font size looks like real neon; much larger and the letters disappear into the haze. 1.5 to 3s per swell feels like breathing.

Text-shadow is repainted on every frame, so keep this effect to a short headline rather than a paragraph, and do not run many instances at once. The glow also lowers the perceived contrast of thin letters, so keep a heavy font weight. The text is real text, so it is selectable and read normally by screen readers.

How do I make the neon flicker instead of pulse?

Replace the two-step keyframe with several steps that drop the text-shadow to almost nothing for a few percent at irregular points (for example at 18%, 22% and 55%) and use steps(1, end) easing so it jumps. Keep flicker rare and brief; rapid flashing can be a problem for photosensitive users.

Why is the text almost white instead of the glow color?

Real neon tubes look nearly white at the core because the light is so intense; the color shows in the halo. Using a pale text color with a colored text-shadow reproduces that. If you want colored letters, set the text color to a lighter tint of Glow color, but keep it lighter than the glow or the effect flattens.

Can I apply the glow to a box instead of text?

The same idea works with box-shadow on an element. Swap text-shadow for box-shadow with the same layers in the keyframe. For a glow that appears only on hover around a card, use the Glow border preset, which already does that with a two-layer box-shadow transition.

relatedMore like this

all css animations →
01 Animated arrow loop
02 Rotate 360° loop
03 Blink loop
04 Heartbeat pulse loop

Export

format
height

480p max · small watermark · 3 per day · remove limits