Button Library · Gradient
Aurora
Soft curtains of colour drift by.
States
Default
Hover
Active
Focus
Code
gradient-aurora.html
<button class="btn-gradient-aurora" type="button"> <span>Get started</span> </button>
gradient-aurora.css
.btn-gradient-aurora {
--btn-bg: #7c5cff;
--btn-bg2: #22d3ee;
--btn-bg3: #f472b6;
--btn-fg: #ffffff;
--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-shadow: none;
--btn-speed: 180ms;
}
.btn-gradient-aurora {
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: radial-gradient(50% 120% at 20% 30%, var(--btn-bg2), transparent) 0% 50% / 180% 180%, radial-gradient(50% 120% at 80% 70%, var(--btn-bg3), transparent) 0% 50% / 180% 180%, var(--btn-bg);
border: var(--btn-bw) solid var(--btn-line);
border-radius: var(--btn-radius);
box-shadow: var(--btn-shadow);
cursor: pointer;
text-decoration: none;
white-space: nowrap;
transition: all var(--btn-speed) ease;
animation: btn-aurora 6s ease-in-out infinite;
}
.btn-gradient-aurora:focus-visible {
outline: 2px solid var(--btn-bg);
outline-offset: 2px;
}
.btn-gradient-aurora:disabled {
opacity: 0.5;
pointer-events: none;
}
.btn-gradient-aurora__icon {
width: 1.15em;
height: 1.15em;
flex-shrink: 0;
}
@keyframes btn-aurora {
0%, 100% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
.btn-gradient-aurora {
animation: none !important;
transition: none !important;
}
}
gradient-aurora.js
// No JavaScript needed: this one is CSS only.
gradient-aurora.tsx
import type React from "react";
import "./gradient-aurora.css"; // the CSS tab
export function BtnGradientAurora({ children = "Get started", ...props }: React.ComponentProps<"button">) {
return (
<button className="btn-gradient-aurora" type="button" {...props}>
<span>{children}</span>
</button>
);
}
gradient-aurora.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-[#ffffff] [background:radial-gradient(50%_120%_at_20%_30%,_#22d3ee,_transparent)_0%_50%_/_180%_180%,_radial-gradient(50%_120%_at_80%_70%,_#f472b6,_transparent)_0%_50%_/_180%_180%,_#7c5cff] [border:0px_solid_#8b6cff] rounded-[10px] [box-shadow:none] cursor-pointer no-underline whitespace-nowrap [transition:all_180ms_ease] [animation:btn-aurora_6s_ease-in-out_infinite] focus-visible:[outline:2px_solid_#7c5cff] focus-visible:[outline-offset:2px] disabled:[opacity:0.5] disabled:[pointer-events:none] motion-reduce:[animation:none!important] motion-reduce:[transition:none!important]" type="button">
<span>Get started</span>
</button>
<!-- A class cannot hold keyframes: keep this in your CSS. -->
<style>
@keyframes btn-aurora {
0%, 100% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
}
</style>