An airport departures board: every tile flips through its drum, one character at a time, to land on your text.
Glass-tube lettering that flickers on letter by letter like a sign warming up, white-hot at the core with its colour glowing onto the wall behind.
Customize
Usage
import { NeonSign } from "@/components/motionkit/neon-sign";
<NeonSign
as="h1"
text="Open late"
buzz={6}
className="text-7xl font-medium tracking-wide"
/>Motion
The exact curves this component runs, plotted with Motion's own maths.
Letters flicker on
Scrolls into view
Wall glow
After the first letters
Tired tube buzzes
Runs on its own
Nightlife, music and events sites, bars and restaurants, retro and arcade brands, and launch pages that want a bit of after-dark atmosphere.
Each letter is drawn twice in the same spot: a faint copy for the unlit glass tube, and a lit copy above it with a near-white core and stacked text shadows in the tube colour, from a tight edge glow out to a wide halo. When the sign scrolls into view, every lit letter runs a short keyframe of stutters (on, off, half, on) from its own fixed delay, so the letters catch one after another. A soft radial pool of the same colour fades in behind for the light on the wall, and one letter can keep a buzz loop for a tired tube. The real text sits once in a visually hidden span for screen readers.
Works in the App Router as is. Requires Tailwind CSS v4.
One command adds the file and installs its dependencies. Needs a components.json (run npx shadcn@latest init once if you don't have one).
npx shadcn@latest add https://www.motionkitui.com/r/neon-sign.jsonnpm install motionSave as components/motionkit/neon-sign.tsx.
"use client";
import { useRef, type CSSProperties, type ElementType } from "react";
import { useInView } from "motion/react";
type NeonSignProps = {
text: string;
/** Colour of the gas in the tubes. */
color?: string;
/** The element to render, e.g. "h1". */
as?: ElementType;
/** Flicker on, letter by letter, like a sign warming up when it scrolls into view. Off, it's simply lit. */
ignite?: boolean;
/** The position of one letter (from 0) that keeps buzzing, as a tired tube does. Leave out for a perfect sign. */
buzz?: number;
/** Strength of the halo round the tubes, 0 to 1. */
glow?: number;
/** Cast a soft pool of coloured light on the wall behind. */
wall?: boolean;
className?: string;
};
// a fixed scatter, so each letter catches at its own moment but the sign behaves the same on every visit
const delay = (index: number) => (((index * 7919) % 11) / 11) * 0.7;
/**
* Glass-tube lettering. Unlit, the tubes show faintly; then each letter catches with a stutter, glowing white-hot at
* the core with its colour bleeding out into a halo and onto the wall behind. One letter can keep buzzing.
*/
export function NeonSign({ text, color = "#FF6FB5", as: Tag = "span", ignite = true, buzz, glow = 0.8, wall = true, className = "" }: NeonSignProps) {
const ref = useRef<HTMLElement>(null);
const inView = useInView(ref, { once: true, amount: 0.5 });
const on = inView || !ignite;
const strength = Math.min(1, Math.max(0, glow));
const halo = (share: number) => `color-mix(in srgb, ${color} ${Math.round(share * strength * 100)}%, transparent)`;
const lit: CSSProperties = {
color: `color-mix(in srgb, ${color} 30%, white)`,
textShadow: `0 0 1px rgb(255 255 255 / 0.6), 0 0 0.05em ${color}, 0 0 0.14em ${color}, 0 0 0.35em ${halo(0.7)}, 0 0 0.8em ${halo(0.45)}`,
};
return (
<Tag ref={ref} data-neon="" data-on={on ? "" : undefined} data-instant={ignite ? undefined : ""} className={`relative isolate inline-block ${className}`}>
<style>{`
@keyframes neon-ignite{0%{opacity:0}7%{opacity:.9}9%{opacity:0}22%{opacity:0}24%{opacity:1}28%{opacity:.15}33%{opacity:1}58%{opacity:.8}100%{opacity:1}}
@keyframes neon-buzz{0%,38%,42%,44%,78%,80%,100%{opacity:1}39%{opacity:.1}41%{opacity:.6}43%{opacity:.05}79%{opacity:.35}}
[data-neon] .neon-lit{opacity:0}
[data-neon][data-on] .neon-lit{animation:neon-ignite 1.1s linear var(--neon-delay) both}
[data-neon][data-on] .neon-lit[data-buzz]{animation:neon-ignite 1.1s linear var(--neon-delay) both,neon-buzz 5.5s linear calc(var(--neon-delay) + 2s) infinite}
[data-neon][data-instant] .neon-lit{animation-name:none;opacity:1}
[data-neon][data-instant] .neon-lit[data-buzz]{animation:neon-buzz 5.5s linear infinite}
[data-neon] .neon-wall{opacity:0;transition:opacity 1.4s ease .5s}
[data-neon][data-on] .neon-wall{opacity:1}
@media (prefers-reduced-motion:reduce){[data-neon] .neon-lit{animation:none!important;opacity:1}[data-neon] .neon-wall{transition:none}}
`}</style>
{wall && (
<span
aria-hidden
className="neon-wall pointer-events-none absolute -inset-x-[15%] -inset-y-[60%] -z-10"
style={{ background: `radial-gradient(closest-side, ${halo(0.28)}, transparent)` }}
/>
)}
<span className="sr-only">{text}</span>
<span aria-hidden className="whitespace-pre">
{Array.from(text).map((char, index) => (
<span key={index} className="relative inline-block whitespace-pre">
{/* the unlit glass tube, faintly visible before and between flickers */}
<span style={{ color: `color-mix(in srgb, ${color} 22%, transparent)` }}>{char}</span>
<span
className="neon-lit absolute inset-0"
data-buzz={index === buzz ? "" : undefined}
style={{ ...lit, "--neon-delay": `${delay(index).toFixed(2)}s` } as CSSProperties}
>
{char}
</span>
</span>
))}
</span>
</Tag>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | — | The words on the sign. |
| color | string | "#FF6FB5" | Colour of the gas in the tubes. |
| ignite | boolean | true | Flicker on, letter by letter, when it scrolls into view. Off, it's simply lit. |
| buzz | number | — | Position of one letter (from 0) that keeps buzzing, like a tired tube. |
| glow | number | 0.8 | Strength of the halo, 0 to 1. |
| wall | boolean | true | Cast a soft pool of coloured light on the wall behind. |
| as | ElementType | "span" | Element to render, e.g. h1. |
How we audit: the WCAG 2.2 animation checklist and respecting reduced motion in React.
Yes. The file starts with "use client", so you can import it straight into a Server Component page or layout. It works in Vite as is, and in Astro as a React island.
Only the motion package, beside React and Tailwind CSS v4. There is no MotionKit package and no Tailwind config to add.
Yes. Run npx shadcn@latest add https://www.motionkitui.com/r/neon-sign.json in any project with a components.json. It saves the file to components/motionkit and installs its dependencies.
With reduced motion on, the sign is simply lit: no flicker on, no buzzing letter.
An airport departures board: every tile flips through its drum, one character at a time, to land on your text.
Solid 3D lettering with real depth, whose extrusion swings round to face away from the cursor like a sign under a moving light.
Crisp letters lit from behind by a soft, slowly flowing glow of colour, the way a new AI feature or a launch headline glows.
Open late