Button Library · Gradient
Neon
Bright edge and glow on near black.
States
Default
Hover
Active
Focus
Code
gradient-neon.html
<button class="btn-gradient-neon" type="button"> <span>Get started</span> </button>
gradient-neon.css
.btn-gradient-neon {
--btn-bg: #0b0b12;
--btn-bg2: #22d3ee;
--btn-fg: #22d3ee;
--btn-font: inherit;
--btn-size: 15px;
--btn-weight: 600;
--btn-px: 22px;
--btn-py: 11px;
--btn-w: auto;
--btn-h: auto;
--btn-bw: 0px;
--btn-line: #8b6cff;
--btn-radius: 10px;
--btn-glow: 18px;
--btn-speed: 180ms;
}
.btn-gradient-neon {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5em;
box-sizing: border-box;
width: var(--btn-w);
height: var(--btn-h);
padding: var(--btn-py) var(--btn-px);
font-family: var(--btn-font);
font-size: var(--btn-size);
font-weight: var(--btn-weight);
line-height: 1.2;
color: var(--btn-fg);
background: var(--btn-bg);
border: var(--btn-bw) solid var(--btn-line);
border-radius: var(--btn-radius);
box-shadow: 0 0 var(--btn-glow) color-mix(in srgb, var(--btn-bg2) 60%, transparent), inset 0 0 0 1.5px var(--btn-bg2);
cursor: pointer;
text-decoration: none;
white-space: nowrap;
transition: all var(--btn-speed) ease;
text-shadow: 0 0 10px var(--btn-bg2);
}
.btn-gradient-neon:focus-visible {
outline: 2px solid var(--btn-bg);
outline-offset: 2px;
}
.btn-gradient-neon:disabled {
opacity: 0.5;
pointer-events: none;
}
.btn-gradient-neon__icon {
width: 1.15em;
height: 1.15em;
flex-shrink: 0;
}
.btn-gradient-neon:hover {
box-shadow: 0 0 calc(var(--btn-glow) * 2) var(--btn-bg2), inset 0 0 0 1.5px var(--btn-bg2);
}
@media (prefers-reduced-motion: reduce) {
.btn-gradient-neon {
animation: none !important;
transition: none !important;
}
}
gradient-neon.js
// No JavaScript needed: this one is CSS only.
gradient-neon.tsx
import type React from "react";
import "./gradient-neon.css"; // the CSS tab
export function BtnGradientNeon({ children = "Get started", ...props }: React.ComponentProps<"button">) {
return (
<button className="btn-gradient-neon" type="button" {...props}>
<span>{children}</span>
</button>
);
}
gradient-neon.html
<button class="relative inline-flex items-center justify-center gap-[0.5em] [box-sizing:border-box] [padding:11px_22px] [font-family:inherit] text-[15px] font-[600] [line-height:1.2] text-[#22d3ee] bg-[#0b0b12] [border:0px_solid_#8b6cff] rounded-[10px] [box-shadow:0_0_18px_color-mix(in_srgb,_#22d3ee_60%,_transparent),_inset_0_0_0_1.5px_#22d3ee] cursor-pointer no-underline whitespace-nowrap [transition:all_180ms_ease] [text-shadow:0_0_10px_#22d3ee] focus-visible:[outline:2px_solid_#0b0b12] focus-visible:[outline-offset:2px] disabled:[opacity:0.5] disabled:[pointer-events:none] hover:[box-shadow:0_0_calc(18px_*_2)_#22d3ee,_inset_0_0_0_1.5px_#22d3ee] motion-reduce:[transition:none!important]" type="button"> <span>Get started</span> </button>