6 Pure CSS1 with JSPublished 2026-10-05Free · no sign-up
Seven interface components in neon style: an outlined tube button, a card framed in cyan light, a text field that glows when focused, a glowing divider, line icons that glow along their strokes, a switch that lights up and an energy meter.
A neon tube button: a thin bright border with an outer glow and a faint inner glow, text in the same tube colour. Hover brightens everything by switching to a stronger shadow stack, and the dark background is what makes the glow work.
A dark card framed by a cyan neon line that glows into the surrounding darkness. The card text stays a calm light grey, because glowing body text is hard to read; only the frame and the heading glow.
View code
<article class="ne2"><h3>Tonight</h3><p>Doors 20:00 · Live set 22:00</p></article>
A text field that lights up with a green neon glow when focused, a strong and very visible focus indicator. The label stays above the field, and the glow is only the focus state, so the resting form is calm.
A glowing horizontal line made from an hr with a gradient that is brightest in the middle and two shadows for the glow. A single element divider that suits gaming and nightlife pages.
SVG line icons drawn in neon by giving their strokes a drop-shadow filter in the same colour. Because the glow comes from the icon's own shape, it follows every curve, which a box-shadow on the svg box cannot do.
A switch whose track lights up pink when it is on, with the knob glowing at the end. It is a real switch button with aria-checked, and the off state is a dim, unlit tube so the two states differ in brightness, not only colour.
var b = document.querySelector('.ne6');
b.onclick = function () { b.setAttribute('aria-checked', b.getAttribute('aria-checked') !== 'true'); };
07. Neon Energy Meter
NeonProgress
A glowing bar for health, energy or upload progress, filled with a gradient from green to yellow and lit by a matching shadow. A native meter element carries the value for screen readers beneath the styled bar.
A tight bright shadow and one or two wider, softer ones in the same hue make the glow. For SVG icons use filter: drop-shadow() so the glow follows the strokes.
Darkness is the canvas
Neon only works on very dark backgrounds. Keep large surfaces near black and save the glow for edges, headings and active states.
Glow the frame, not the text
Body text that glows is hard to read. Keep paragraphs in a calm light grey and let borders, icons and headings carry the effect.
States must differ in brightness
On and off should differ in lightness, not only in colour, so people with colour vision deficiencies can still tell them apart.
Frequently asked questions
How is this different from neon text?
The neon text collection is about lettering; this one applies the look to buttons, inputs and other components.
Will neon pass contrast checks?
The text colours here are near-white on near-black, which passes easily; glow does not count toward contrast.
Can neon work in light mode?
Not really. Use coloured shadows instead on light pages.