Components

Glow Text

A neon text effect for React and Tailwind CSS: a single soft text-shadow glow, static by default with optional breathing or flickering, in any color and at any heading level. It stays real, selectable text, so headings remain readable by search engines and screen readers.

  • SEO-friendly real text
  • Heading levels via as
  • Breathe & flicker
  • No re-renders
  • prefers-reduced-motion

Open all night

Installation

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

Usage

page-title.tsx
import { GlowText } from "@/components/dusk/neon/glow-text"

export function PageTitle() {
  return (
    <GlowText as="h1" color="#22d3ee" className="text-5xl font-bold">
      Night Market
    </GlowText>
  )
}

Examples

Animations

none (default) keeps the glow static; breathe slowly swells it; flicker holds steady and occasionally stutters like an old sign. Tune the cycle with speed.

Static

Breathe

Flicker

Colors & intensity

Any CSS color works. intensity scales the glow, and the font is entirely yours.

CyanAmberVioletEmber

Inline

Render it as strong or span to highlight a word inside running text.

Ship animated interfaces with DuskUI. The glow is a plain text-shadow, so the words stay selectable and searchable.

API Reference

Also accepts any HTML attribute for the rendered element.

PropTypeDefaultDescription
as"h1" … "h6" | "p" | "span" | "div" | "strong""span"Element to render. Use a heading level for titles.
colorstringvar(--color-primary)Any CSS color for the glow; the letters use a light tint of it.
intensitynumber1Glow strength multiplier. 0 removes the glow.
animation"none" | "breathe" | "flicker""none"Glow animation. Always none with reduced motion.
speednumber3.2 (breathe) / 4 (flicker)Seconds per cycle. Flicker is clamped to at least 2s.
classNamestring—Font size, weight and other text styles.

Accessibility

  • The text is a single real element with no duplicated or aria-hidden copies, so it is selectable, translatable and indexed like any heading.
  • Use as to keep the correct heading level in the document outline.
  • Only the glow animates; the letters never blink. Flicker produces at most two soft dips per second, under the WCAG 3-flashes threshold.
  • With prefers-reduced-motion the glow is static.
  • Letters are rendered as a light tint of the color for strong contrast on dark backgrounds.