20 CSS Neon Effects

17 Pure CSS3 Light JSPublished 8 new designs · Updated on

A neon glow is layered light: a tight bright core, a mid halo, and a wide dim bloom — three stacked shadows where one large blur only reads as a coloured smudge. These 20 hand-coded patterns cover the glow anatomy, drop-shadow for irregular shapes, why some hues read as luminous and others muddy, inner-glow emission, animatable intensity with @property, SVG filter merges, the real paint cost, and keeping text legible against a dark ground. Scoped under .nn-NN; drops into React, Vue, Svelte, or Astro.

Related20 CSS Neon Text Effects15 CSS Glowing Border Buttons20 CSS Retro UI16 CSS Glitch Text Effects20 Tailwind CSS Grain Texture

Premium design systemPartner: Untitled UI

Affiliate link

Taking this style from one component to a whole product?

You just browsed 20 neon patterns. Untitled UI is the Figma UI kit 380,000+ designers use, with 10,000+ components and variants in Pro, plus a matching React library on Tailwind CSS. Figma Pro is a one-time purchase from $129.

Get Untitled UI Pro

Untitled UI. We may earn a commission, at no extra cost to you.

01. CSS Glow Anatomy with Layered Box Shadow (opens in a new tab)

Published

Pure CSSNEW
The reference build the rest of this collection borrows from. One element carries one annotated shadow stack, so you can see why a single large blur reads as a coloured smudge while three stacked shadows — a tight bright core, a mid halo, a wide dim bloom — read as emitted light. Each layer is labelled with its offset, blur, spread and alpha.

02. Drop Shadow Glow for Irregular Shapes (opens in a new tab)

Published

Pure CSSNEW
box-shadow follows the element's border box, so a glow on a transparent image, an inline <svg> or a clip-path shape halos the rectangle instead of the artwork. filter: drop-shadow() follows the alpha channel instead. Both are applied to the same shape here, labelled, with the box version visibly wrong — plus what the swap costs you.

03. Neon Color Choice and Perceived Luminance (opens in a new tab)

Published

Pure CSSNEW
Why cyan and magenta glow convincingly while a deep blue or a brown reads as mud at identical shadow values. Perceived luminance varies enormously by hue at the same nominal lightness, so one fixed alpha and blur produces wildly different results across a palette. One recipe is applied to eight hues, the failures are labelled, then the same eight are corrected with oklch().

04. Inner Glow and Faked Light Emission (opens in a new tab)

Published

Pure CSSNEW
Outer glow makes an object look lit from outside; inner glow makes the surface itself look like the light source. A stack of inset shadows plus a bright core colour fakes emission on a tube, a bar or a panel edge. A tube built from inset layers sits beside one built only from outer shadows, both labelled, so the difference between a lit object and a light source is visible.

05. Animating Glow Intensity with at-property (opens in a new tab)

Published

Pure CSSNEW
An unregistered custom property cannot interpolate, so animating --glow steps between values instead of easing between them — the single most common "why won't my neon pulse" question. Registering it with @property and a typed syntax makes intensity animatable independently of hue. The broken version sits beside the working one.

06. Glow on SVG Paths and Stroke Elements (opens in a new tab)

Published

Pure CSSNEW
Glow on SVG has two routes with different trade-offs. CSS filter: drop-shadow() on the element is simpler and inherits currentColor; a native <filter> with <feGaussianBlur> and <feMerge> allows a true multi-layer merge inside the SVG. One stroked route is lit both ways, labelled, including the filter-region trap that clips a glow at the edge.
Newsletter

Enjoying these demos? Get new ones by email.

A short email when a new collection ships. Unsubscribe any time.

at

Almost there: check your inbox to confirm.Manage

07. Neon Glow Paint Cost and What to Animate (opens in a new tab)

Published

Light JSNEW
Large blur radii are among the most expensive things a browser repaints, and neon uses several per element by construction. Animating the shadow repaints the full blurred area every frame; animating opacity on a pre-built glow layer composites instead. Both run side by side under a deliberate main-thread load, with a live frame counter, so the difference is measured rather than asserted.

08. Accessible Neon on Dark Backgrounds (opens in a new tab)

Published

Pure CSSNEW
Neon's accessibility problem is the inverse of most dark themes: the glow is decorative and carries no contrast, so a thin bright glyph on near-black can look vivid while the text itself fails. A naive heading is shown with its measured ratio, then the fix — 4.5:1 on the core colour alone, adequate stroke weight, and a reduced-motion path that stops the pulse without dimming anything.

09. Neon Glow Button Construction Reference (opens in a new tab)

PublishedUpdated

Pure CSS
The three-layer stack applied to the smallest honest test surface: a button with rest, hover, active and focus-visible states, each layer annotated with the values it uses. The chrome is deliberately plain so the subject stays the light — what changes between states, what must not change, and why the focus state is a ring rather than a brighter halo.

10. Neon Heading and Display Type Glow (opens in a new tab)

PublishedUpdated

Pure CSS
Display type as a typographic problem rather than an effect: how stroke weight and letter-spacing govern how much glow a glyph can carry before its counters fill in and the whole line smears. Four specimens hold the same glow stack while weight and tracking change, so the failure point is visible instead of theoretical.

11. Neon Pricing Table with Glow Tiers (opens in a new tab)

PublishedUpdated

Pure CSS
Glow used as hierarchy rather than decoration: the recommended tier carries the full three-layer stack, the neighbours keep a single dim halo, and the difference is legible from across the room. Because brightness alone cannot carry meaning, the featured tier is also labelled and marked, so the ranking survives with the light switched off.

12. Layered Glow Scene with Depth Falloff (opens in a new tab)

PublishedUpdated

Pure CSS
A composed scene where glow intensity falls off with distance: near elements are tight and bright, far ones are wide, dim and desaturated, with a haze layer between the bands. It is a depth study — the same three-layer stack tuned three ways to produce atmospheric perspective from nothing but shadow values.

13. Neon Form Inputs and Focus Glow (opens in a new tab)

PublishedUpdated

Pure CSS
Inputs where focus produces a glow, built so the glow is never the thing doing the work. A real 2px ring carries the focus requirement, the glow carries the character, and validity is signalled with text and a mark as well as light. No script and no <form> element — only :focus-visible, :has() and native validity.

14. Neon Navigation with Active Glow State (opens in a new tab)

PublishedUpdated

Pure CSS
A navigation bar where the current item glows — and where the glow is the third signal, not the only one. aria-current drives a weight change, a solid indicator bar and the light together, so the current page is identifiable with the glow removed, in forced-colours mode, or by anyone who cannot separate the two hues.
Newsletter

Enjoying these demos? Get new ones by email.

A short email when a new collection ships. Unsubscribe any time.

at

Almost there: check your inbox to confirm.Manage

15. Flicker Timing and Failing Tube Effect (opens in a new tab)

PublishedUpdated

Light JS
Flicker treated as a timing problem, not a look. Irregular keyframe percentages, steps() for instant transitions and short dead intervals are what make a failing tube read as real instead of as a strobe. The timing is charted, the peak rate is stated, and the whole thing stays under three flashes per second because that limit is a seizure threshold.

16. Cyberpunk Neon Palette and Token Set (opens in a new tab)

PublishedUpdated

Pure CSS
A token system where one hue value drives the core, halo and bloom layers across a small component set, so retinting is a one-value edit rather than a search-and-replace. Three hue presets switch the entire set with no JavaScript, using :has() on radio inputs, and the token table shows exactly what is derived from what.

17. Tailwind Neon Glow Utility Recipe (opens in a new tab)

PublishedUpdated

Pure CSS
The three-layer stack expressed as a utility, in both the v3 @layer utilities form and the v4 @theme form, with the rendered result built in plain CSS so it runs anywhere. Includes the part most recipes skip: why an arbitrary-value shadow is the wrong place for a glow, and how additive blending changes what the utility should contain.

18. Neon Icon Glow with SVG Filters (opens in a new tab)

PublishedUpdated

Pure CSS
Demo 06's technique applied at component scale: an icon set lit by one shared SVG <filter>, defined once and referenced by every glyph. Covers the two things that bite at set scale — a filter id that has to be unique across the whole document, and the per-icon cost of a filter that is cheap on one glyph and expensive on twenty.

19. Infinite Neon Grid and Perspective Floor (opens in a new tab)

PublishedUpdated

Light JS
A perspective floor treated as geometry plus falloff: a repeating grid on a rotated plane, translated by exactly one cell per loop so the motion is seamless, with glow fading toward the horizon via a mask rather than by dimming the lines. Speed and density are adjustable, and the whole thing animates one transform.

20. Multi Hue Neon Gradient Glow (opens in a new tab)

PublishedUpdated

Pure CSS
A glow whose hue shifts across the element, built two ways on the same surface: layered box-shadows in different hues offset around the edges, and a blurred gradient layer sitting behind the panel. Both are labelled with what they cost and where each one wins.
FAQ

Frequently asked questions

How do you make a neon glow effect in CSS?
Stack shadows rather than enlarging one. A single large blur — something like 0 0 48px cyan — spreads the same light evenly and reads as a coloured smudge, because real emitted light does not fall off linearly. Three tiers do read as light: a tight, almost-opaque core at small blur that says where the light comes from; a mid halo at roughly half the core's alpha and three times its blur, which carries the falloff; and a wide, very dim bloom that suggests light spilling into the surrounding air. The same principle applies whether you are using box-shadow on a box or text-shadow on type. The one rule that governs all of it is that glow only reads as light against a dark ground — the effect is additive brightness, and on white there is nothing left to add. Demo 01 renders the one-layer and three-layer versions side by side with every value annotated.
Why does my glow look like a rectangle around a transparent image?
Because box-shadow follows the element's box, not its visible pixels. Applied to a transparent PNG, an inline SVG icon, or anything cut with clip-path, it draws a halo around the bounding rectangle while the artwork inside floats unlit. filter: drop-shadow() solves it by following the alpha channel instead, so the glow traces the actual silhouette. Two costs come with that. drop-shadow is more expensive than box-shadow, and stacking three of them to build the layered effect compounds it, so keep the stack shallower on anything animated. And because it is a filter, it establishes a containing block for fixed-position descendants, which occasionally surprises people who have a positioned child inside the glowing element. Demo 02 shows both applied to the same clipped shape with the box-shadow version visibly wrong.
Why do some neon colours look bright and others look muddy?
Because perceived luminance varies enormously by hue even at identical lightness values. Cyan and magenta sit near the top of the visible range and glow convincingly at modest alpha; a deep blue or a brown at the same shadow settings looks dull and slightly dirty, because there is far less perceived brightness to spread. This is why a neon palette copied from a tutorial falls apart the moment you recolour it to match a brand. The fix is to stop treating alpha and blur as fixed and let lightness vary per hue — oklch() makes that practical because its lightness channel is perceptually uniform, so equal L values across hues actually look equally bright. Demo 03 applies one shadow recipe across eight hues, labels the failures, then shows the corrected version.
How do I animate a neon glow without tanking performance?
Do not animate the shadow. Large blur radii are among the most expensive things a browser repaints, and neon uses several per element by construction, so animating box-shadow or filter repaints the entire blurred area on every frame. Build the glow once on a dedicated layer, then animate that layer's opacity or transform, which composites instead of repainting. The other half of the answer is that an unregistered custom property cannot interpolate at all — animating --glow silently does nothing, which is the most common reason a pulse appears not to work. Registering it with @property and a typed syntax makes intensity animatable independently of hue, so a pulse can brighten without shifting colour. Demo 07 races both approaches under a deliberate main-thread load, and demo 05 shows the silent no-op beside the registered version.
Is neon text accessible?
Only if the contrast comes from the glyph rather than the glow. A diffuse halo supplies no reliable contrast — it is soft-edged, semi-transparent and varies across its own area — so the core colour has to carry the full 4.5:1 against the background on its own, measured with the glow disregarded entirely. The trap is that saturated neon on near-black often looks vivid while measuring well below that, because the glow reads as brightness the contrast algorithm does not count. Stroke weight matters too: a thin glyph with a heavy bloom loses its edges into the glow and gets harder to read the more impressive it looks. And any pulsing must respect prefers-reduced-motion by stopping the animation without dimming the text, so reduced motion never becomes reduced legibility. Demo 08 shows a failing heading with a live contrast readout beside the corrected version.
Is a flickering neon sign safe to ship?
Only under a hard limit. WCAG 2.2 SC 2.3.1 allows no more than three flashes in any one-second period, and a luminance flicker that breaks it is a genuine seizure risk rather than a taste question. That constraint shapes how a convincing flicker is built: the realism comes from irregular timing rather than speed — long stable stretches broken by short clusters, with steps() for the abrupt on-off transitions and a few very brief dead intervals where the tube fails entirely. Even paced, an evenly blinking sign both looks fake and approaches the limit faster. The flicker in this collection runs at roughly 1.8 flashes per second, comfortably inside the threshold, and is fully disabled under prefers-reduced-motion. Demo 15 documents the timing directly.
Does neon work on a light background?
Not really, and it is worth being honest about that rather than shipping a light variant that pretends otherwise. Glow is additive brightness: the shadow layers add light to what is behind them, so against white there is no headroom left and the same declarations render as a soft grey-coloured blur — closer to a dropped shadow than to emitted light. Every demo here is dark-grounded by default for that reason. The light variants exist and are usable, but they are a muted treatment: the glow is reduced, the core colours are darkened to hold contrast, and the effect reads as a coloured accent rather than as light. If a design genuinely needs a light background, a solid accent colour or a crisp border will communicate emphasis far better than a weak glow.
How is this different from the neon text and glowing button collections?
Three collections sit adjacent and each owns a distinct thing. This one covers the lighting technique itself — how the glow is constructed, which properties build it, what it costs, and how to keep it accessible. css-neon-text-effect (20 demos) owns neon applied to type: flickering signs, synthwave headings, glitch text, gradient flow, the Tailwind text-glow utility, and typing terminals. css-glowing-border-buttons (15 demos) owns glow applied to buttons and borders as components: rotating gradient borders, cyberpunk corner treatments, breathing pulses. If you are asking why your glow looks like a smudge, why it haloes a rectangle around your icon, or why your palette went muddy when you recoloured it, you are in the right place. If you want a finished neon headline or a glowing CTA, the other two are the faster route.

Related collections

20 CSS 3D Effects preview

20 CSS 3D Effects

20 hand-coded CSS 3D patterns covering the transform pipeline reference build, the perspective property versus the perspective function, perspective-origin as the camera position, why transform function order changes the result, backface-visibility on two sided elements, what silently flattens preserve-3d, building a cube from six faces, transform-origin in three dimensions, translateZ versus scale for depth, z-fighting on coplanar surfaces, rotate3d and the transform matrix, plus ring layouts, stacked z-planes, pointer tilt with parallax, a hinged page-turn flipbook, a drag-rotate cube navigator, an extruded synth panel, perspective floor geometry, nested 3D contexts, and helix distribution. 14 demos are pure CSS; 6 use vanilla JavaScript.

22 CSS Brutalism preview

22 CSS Brutalism

22 hand-coded brutalist and neubrutalist CSS designs covering the full spectrum of the aesthetic — from the anti-design brutalism of 2014-2018 (raw system fonts, zero border radius, monochrome density, visible structure) through to the neubrutalism of 2021-present (bright pastel fills, thick black borders, hard offset shadows with zero blur, rounded blocks). The neubrutalist half ships SaaS pricing cards with sticker badges, a pastel admin dashboard, signup forms, rotated feature cards, an offset-shadow navbar, a playful button set, a native dialog modal, a testimonial wall, blog cards, chunky toggles, a landing hero, an image gallery, stats panels and a rounded footer. The brutalist half covers product grids, raw form controls, a monochrome data dashboard, a portfolio index, indie SaaS pricing, Windows 95 desktop chrome, editorial long-read and a streetwear catalog. Every design is scoped under a .brt-NN prefix for no-collision pasting, guards prefers-reduced-motion, and ports unchanged to React, Vue, Svelte, Astro, Next.js and Tailwind.

20 CSS Claymorphism preview

20 CSS Claymorphism

20 hand-coded CSS claymorphism designs covering the three-layer shadow recipe that defines the style, inner highlight and inner shadow layering, the border radius scale that makes shapes read as puffy rather than merely rounded, claymorphism compared side by side with neumorphism, a clay and glassmorphism hybrid, single light-source discipline across a layout, depth tiers for visual hierarchy, a Tailwind implementation with both arbitrary values and theme tokens, squishy button press states, toggles and checkboxes, inset input wells and search bars, badge and pill systems, cards, popover-based modals, pricing tables, mobile tab bars, app icon grids, toast and alert bubbles, dark mode shadow recalibration, and the paint cost of animating shadows. 19 demos are pure CSS; 1 uses vanilla JavaScript.

Search CodeFronts

Loading…