Gradient glow button
A blurred gradient halo breathes around the button, hover sweeps a band of light across its face and the press lands on an overshoot spring — with the big CTA cut for the moment of decision and a live reservation counter.
Real scenarios
The component as it is used in a product — not a specimen grid.
The launch CTA
The halo breathes on its own; hover sends a band of light across the face and the press lands on a spring. Every reservation counts you into the Singapore batch.
The batch caps at 250 — Singapore, January 21. You are number in this batch.
Everyday sizes
The same halo, quieter, for rows and toolbars — it sits beside ghost actions without drowning them.
Presses across the page all feed the same counter.
جهت دیگر
جاروی نور در راستبهچپ از سوی دیگر میگذرد؛ هاله و فنر همانها میمانند. لینک هم گرادیان و هاله را به ارث میبرد.
2 روز — سنگاپور و دوبلین
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| halo | layer | 'blur(20px) · 2.6s' | The halo inherits the button’s gradient and breathes behind a blur, pulsing scale and opacity; slightly stronger in dark mode. |
| sweep | event | 'hover · .9s' | A skewed band of light crosses the face on hover or focus; from the opposite side in RTL. |
| press | spring | 'cubic-bezier(.34,1.56,.64,1)' | Pressing squeezes the button to .93 and the overshoot spring returns it — a physical click. |
| size | string | 'md' | md for rows and toolbars; cta is the big hero cut with a wider halo. |
Snippet
<div class="ggb" x-data="{ count: 0, locale: 'en-US' }">
<span class="ggb-wrap">
<span class="ggb-halo" aria-hidden="true"></span>
<button type="button" class="ggb-btn" data-size="cta" x-on:click="count++">
<span class="ggb-label">Reserve your seat</span>
</button>
</span>
<p class="ggb-count" role="status">
<span x-show="count === 0">The batch caps at 250 — Singapore, January 21.</span>
<span x-show="count > 0" x-cloak>
You are number <b x-text="count.toLocaleString(locale)"></b> in this batch.
</span>
</p>
<div class="ggb-row">
<span class="ggb-wrap">
<span class="ggb-halo" aria-hidden="true"></span>
<button type="button" class="ggb-btn" x-on:click="count++">Start free</button>
</span>
<span class="ggb-wrap">
<span class="ggb-halo" aria-hidden="true"></span>
<button type="button" class="ggb-btn" x-on:click="count++">Talk to sales</button>
</span>
</div>
</div>
<style>
.ggb { --ggb-a: #6366f1; --ggb-b: #a855f7; --ggb-c: #ec4899; --ggb-halo-op: .45;
display: grid; gap: 1rem; justify-items: center; }
.ggb-row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: center; }
.ggb-wrap { position: relative; display: inline-block; isolation: isolate; }
.ggb-halo { position: absolute; inset: -8px -14px; z-index: -1; border-radius: 999px;
background: linear-gradient(135deg, var(--ggb-a), var(--ggb-b) 50%, var(--ggb-c));
filter: blur(20px); opacity: var(--ggb-halo-op);
animation: ggb-pulse 2.6s ease-in-out infinite; }
.ggb-btn { position: relative; overflow: hidden; border: 0; border-radius: 999px; cursor: pointer;
padding: .75rem 1.7rem; color: #fff; font-weight: 700; font-size: .95rem; line-height: 1.4;
background: linear-gradient(135deg, var(--ggb-a), var(--ggb-b) 50%, var(--ggb-c));
transition: scale .45s cubic-bezier(.34, 1.56, .64, 1); }
.ggb-btn::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .5) 50%, transparent 58%);
translate: -130% 0; }
.ggb-btn:hover::after, .ggb-btn:focus-visible::after { animation: ggb-sweep .9s ease; }
.ggb-btn:hover, .ggb-btn:focus-visible { scale: 1.03; }
.ggb-btn:active { scale: .93; }
.ggb-btn:focus-visible { outline: 2px solid #e9d5ff; outline-offset: 4px; }
.ggb-btn[data-size='cta'] { padding: 1.1rem 2.6rem; font-size: 1.25rem; }
.ggb-wrap:has(.ggb-btn[data-size='cta']) .ggb-halo { inset: -12px -20px; filter: blur(26px); }
html[dir='rtl'] .ggb-btn::after { translate: 130% 0; }
html[dir='rtl'] .ggb-btn:hover::after,
html[dir='rtl'] .ggb-btn:focus-visible::after { animation-name: ggb-sweep-rtl; }
@keyframes ggb-pulse { 0%, 100% { opacity: .32; scale: .97; } 50% { opacity: .62; scale: 1.05; } }
@keyframes ggb-sweep { to { translate: 130% 0; } }
@keyframes ggb-sweep-rtl { to { translate: -130% 0; } }
@media (prefers-reduced-motion: reduce) {
.ggb-halo { animation: none; }
.ggb-btn::after { display: none; }
.ggb-btn { transition: none; }
}
</style>
// app/Pages/Launch.jsx — Inertia (React) page; renders the React
// snippet below unchanged, with Inertia's Link wired into the provider.
import { Link } from '@inertiajs/react';
import { NabuXUIProvider } from '@nabuxai/ui-react';
import ReserveCta from '@/components/ReserveCta';
export default function Launch() {
return (
<NabuXUIProvider locale="en" linkComponent={Link}>
<main className="nx-page">
<ReserveCta />
</main>
</NabuXUIProvider>
);
}
// ReserveCta.jsx — the gradient glow button: pulsing halo, hover sweep,
// springy press and a live reservation counter
import { useState } from 'react';
import '@nabuxai/ui-core/css';
export default function ReserveCta() {
const [count, setCount] = useState(0);
return (
<>
<style>{`
.ggb { display: grid; gap: 1rem; justify-items: center;
--ggb-a: #6366f1; --ggb-b: #a855f7; --ggb-c: #ec4899; --ggb-halo-op: .45; }
.ggb-row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: center; }
.ggb-wrap { position: relative; display: inline-block; isolation: isolate; }
.ggb-halo { position: absolute; inset: -8px -14px; z-index: -1; border-radius: 999px;
background: linear-gradient(135deg, var(--ggb-a), var(--ggb-b) 50%, var(--ggb-c));
filter: blur(20px); opacity: var(--ggb-halo-op);
animation: ggb-pulse 2.6s ease-in-out infinite; }
.ggb-btn { position: relative; overflow: hidden; border: 0; border-radius: 999px; cursor: pointer;
padding: .75rem 1.7rem; color: #fff; font: 700 .95rem/1.4 system-ui;
background: linear-gradient(135deg, var(--ggb-a), var(--ggb-b) 50%, var(--ggb-c));
transition: scale .45s cubic-bezier(.34, 1.56, .64, 1); }
.ggb-btn::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .5) 50%, transparent 58%);
translate: -130% 0; }
.ggb-btn:hover::after, .ggb-btn:focus-visible::after { animation: ggb-sweep .9s ease; }
.ggb-btn:hover, .ggb-btn:focus-visible { scale: 1.03; }
.ggb-btn:active { scale: .93; }
.ggb-btn[data-size='cta'] { padding: 1.1rem 2.6rem; font-size: 1.25rem; }
.ggb-wrap:has(.ggb-btn[data-size='cta']) .ggb-halo { inset: -12px -20px; filter: blur(26px); }
@keyframes ggb-pulse { 0%, 100% { opacity: .32; scale: .97; } 50% { opacity: .62; scale: 1.05; } }
@keyframes ggb-sweep { to { translate: 130% 0; } }
@media (prefers-reduced-motion: reduce) {
.ggb-halo { animation: none; }
.ggb-btn::after { display: none; }
.ggb-btn { transition: none; }
}
`}</style>
<div className="ggb">
<span className="ggb-wrap">
<span className="ggb-halo" aria-hidden="true" />
<button type="button" className="ggb-btn" data-size="cta" onClick={() => setCount(count + 1)}>
<span className="ggb-label">Reserve your seat</span>
</button>
</span>
<p className="ggb-count" role="status">
{count === 0
? 'The batch caps at 250 — Singapore, January 21.'
: <>You are number <b>{count.toLocaleString('en-US')}</b> in this batch.</>}
</p>
<div className="ggb-row">
{['Start free', 'Talk to sales'].map((label) => (
<span key={label} className="ggb-wrap">
<span className="ggb-halo" aria-hidden="true" />
<button type="button" className="ggb-btn" onClick={() => setCount(count + 1)}>{label}</button>
</span>
))}
</div>
</div>
</>
);
}
<!-- ReserveCta.vue — the gradient glow button: pulsing halo, hover sweep,
springy press and a live reservation counter -->
<script setup lang="ts">
import { ref } from 'vue';
import '@nabuxai/ui-core/css';
const count = ref(0);
</script>
<template>
<div class="ggb">
<span class="ggb-wrap">
<span class="ggb-halo" aria-hidden="true"></span>
<button type="button" class="ggb-btn" data-size="cta" @click="count++">
<span class="ggb-label">Reserve your seat</span>
</button>
</span>
<p class="ggb-count" role="status">
<template v-if="count === 0">The batch caps at 250 — Singapore, January 21.</template>
<template v-else>You are number <b>{{ count.toLocaleString('en-US') }}</b> in this batch.</template>
</p>
<div class="ggb-row">
<span v-for="label in ['Start free', 'Talk to sales']" :key="label" class="ggb-wrap">
<span class="ggb-halo" aria-hidden="true"></span>
<button type="button" class="ggb-btn" @click="count++">{{ label }}</button>
</span>
</div>
</div>
</template>
<style scoped>
.ggb { display: grid; gap: 1rem; justify-items: center;
--ggb-a: #6366f1; --ggb-b: #a855f7; --ggb-c: #ec4899; --ggb-halo-op: .45; }
.ggb-row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: center; }
.ggb-wrap { position: relative; display: inline-block; isolation: isolate; }
.ggb-halo { position: absolute; inset: -8px -14px; z-index: -1; border-radius: 999px;
background: linear-gradient(135deg, var(--ggb-a), var(--ggb-b) 50%, var(--ggb-c));
filter: blur(20px); opacity: var(--ggb-halo-op);
animation: ggb-pulse 2.6s ease-in-out infinite; }
.ggb-btn { position: relative; overflow: hidden; border: 0; border-radius: 999px; cursor: pointer;
padding: .75rem 1.7rem; color: #fff; font: 700 .95rem/1.4 system-ui;
background: linear-gradient(135deg, var(--ggb-a), var(--ggb-b) 50%, var(--ggb-c));
transition: scale .45s cubic-bezier(.34, 1.56, .64, 1); }
.ggb-btn::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .5) 50%, transparent 58%);
translate: -130% 0; }
.ggb-btn:hover::after, .ggb-btn:focus-visible::after { animation: ggb-sweep .9s ease; }
.ggb-btn:hover, .ggb-btn:focus-visible { scale: 1.03; }
.ggb-btn:active { scale: .93; }
.ggb-btn[data-size='cta'] { padding: 1.1rem 2.6rem; font-size: 1.25rem; }
.ggb-wrap:has(.ggb-btn[data-size='cta']) .ggb-halo { inset: -12px -20px; filter: blur(26px); }
@keyframes ggb-pulse { 0%, 100% { opacity: .32; scale: .97; } 50% { opacity: .62; scale: 1.05; } }
@keyframes ggb-sweep { to { translate: 130% 0; } }
@media (prefers-reduced-motion: reduce) {
.ggb-halo { animation: none; }
.ggb-btn::after { display: none; }
.ggb-btn { transition: none; }
}
</style>
<!-- ReserveCta.svelte — the gradient glow button: pulsing halo, hover
sweep, springy press and a live reservation counter -->
<script lang="ts">
import '@nabuxai/ui-core/css';
const labels = ['Start free', 'Talk to sales'];
let count = $state(0);
</script>
<div class="ggb">
<span class="ggb-wrap">
<span class="ggb-halo" aria-hidden="true"></span>
<button type="button" class="ggb-btn" data-size="cta" onclick={() => count++}>
<span class="ggb-label">Reserve your seat</span>
</button>
</span>
<p class="ggb-count" role="status">
{#if count === 0}
The batch caps at 250 — Singapore, January 21.
{:else}
You are number <b>{count.toLocaleString('en-US')}</b> in this batch.
{/if}
</p>
<div class="ggb-row">
{#each labels as label (label)}
<span class="ggb-wrap">
<span class="ggb-halo" aria-hidden="true"></span>
<button type="button" class="ggb-btn" onclick={() => count++}>{label}</button>
</span>
{/each}
</div>
</div>
<style>
.ggb { display: grid; gap: 1rem; justify-items: center;
--ggb-a: #6366f1; --ggb-b: #a855f7; --ggb-c: #ec4899; --ggb-halo-op: .45; }
.ggb-row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: center; }
.ggb-wrap { position: relative; display: inline-block; isolation: isolate; }
.ggb-halo { position: absolute; inset: -8px -14px; z-index: -1; border-radius: 999px;
background: linear-gradient(135deg, var(--ggb-a), var(--ggb-b) 50%, var(--ggb-c));
filter: blur(20px); opacity: var(--ggb-halo-op);
animation: ggb-pulse 2.6s ease-in-out infinite; }
.ggb-btn { position: relative; overflow: hidden; border: 0; border-radius: 999px; cursor: pointer;
padding: .75rem 1.7rem; color: #fff; font: 700 .95rem/1.4 system-ui;
background: linear-gradient(135deg, var(--ggb-a), var(--ggb-b) 50%, var(--ggb-c));
transition: scale .45s cubic-bezier(.34, 1.56, .64, 1); }
.ggb-btn::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .5) 50%, transparent 58%);
translate: -130% 0; }
.ggb-btn:hover::after, .ggb-btn:focus-visible::after { animation: ggb-sweep .9s ease; }
.ggb-btn:hover, .ggb-btn:focus-visible { scale: 1.03; }
.ggb-btn:active { scale: .93; }
.ggb-btn[data-size='cta'] { padding: 1.1rem 2.6rem; font-size: 1.25rem; }
.ggb-wrap:has(.ggb-btn[data-size='cta']) .ggb-halo { inset: -12px -20px; filter: blur(26px); }
@keyframes ggb-pulse { 0%, 100% { opacity: .32; scale: .97; } 50% { opacity: .62; scale: 1.05; } }
@keyframes ggb-sweep { to { translate: 130% 0; } }
@media (prefers-reduced-motion: reduce) {
.ggb-halo { animation: none; }
.ggb-btn::after { display: none; }
.ggb-btn { transition: none; }
}
</style>