Gradient border button
A conic-gradient ring circling the button as the layer beneath it rotates — hover spins it several times faster; the inner surface is glass, the picked region earns a thicker ring, and a dial sets the spin speed.
Real scenarios
The component as it is used in a product — not a specimen grid.
Deploy to the edge
The conic ring never stops circling — hover a button and it spins four times faster. The inner face is glass, the picked region thickens its ring, and the dial sets the pace for the whole board.
Queued in — live in about 90 seconds.
Pill or rounded
The ring is the border itself — 1.5px of glass padding on pill, the same rhythm squared off at 14px for the changelog cut.
لینک با حلقهٔ چرخان
چرخش حاشیه به جهت کار ندارد؛ لینک هم همان دکمه است و حلقه دورش میگردد.
دموی 30 دقیقهای — ساعت کبری و ساعت سنتی
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| ring | technique | 'rotating ::before' | The conic layer spins with a negative inset under the glass surface; oversized on every side, it never bares a corner — no @property, works everywhere. |
| --gbb-speed | duration | '4s' | The ring’s base spin; hover drops it to 1s and the pressed button to half. |
| surface | glass | 'blur(12px)' | The translucent inner blurring whatever sits behind; dark mode swaps in darker glass and lighter ink. |
| shape | string | 'pill' | pill or rounded; the inner surface stays concentric with the ring. |
| aria-pressed | state | 'false' | The active button (the picked region) earns a thicker ring — for the eye and the screen reader alike. |
Snippet
<div class="gbb" x-data="{ speed: 4, region: 'eu-de-2', queued: null }"
x-bind:style="'--gbb-speed:' + speed + 's'">
<div class="gbb-dial">
<label for="gbb-speed-input">Ring speed</label>
<input id="gbb-speed-input" type="range" min="1" max="6" step="0.5" x-model.number="speed">
<output x-text="speed + ' s'"></output>
</div>
<button type="button" class="gbb-btn" data-size="lg" x-on:click="queued = region">
<span class="gbb-inner">Deploy the edge app</span>
</button>
<div class="gbb-regions" role="group" aria-label="Deploy region">
<button type="button" class="gbb-btn" x-bind:aria-pressed="region === 'eu-de-2'"
x-on:click="region = 'eu-de-2'"><span class="gbb-inner">Frankfurt <small>· eu-de-2</small></span></button>
<button type="button" class="gbb-btn" x-bind:aria-pressed="region === 'eu-ie-1'"
x-on:click="region = 'eu-ie-1'"><span class="gbb-inner">Dublin <small>· eu-ie-1</small></span></button>
<button type="button" class="gbb-btn" x-bind:aria-pressed="region === 'ap-se-1'"
x-on:click="region = 'ap-se-1'"><span class="gbb-inner">Singapore <small>· ap-se-1</small></span></button>
</div>
<p class="gbb-status" role="status" x-show="queued" x-cloak>
Queued in <span x-text="queued"></span> — live in about 90 seconds.
</p>
</div>
<style>
.gbb { --gbb-speed: 4s; --gbb-ink: #0f172a; --gbb-glass: rgba(255, 255, 255, .78);
display: grid; gap: 1rem; justify-items: center; }
.gbb-btn { position: relative; overflow: hidden; padding: 1.5px; border: 0; border-radius: 999px;
background: transparent; cursor: pointer; }
.gbb-btn::before { content: ''; position: absolute; inset: -60%;
background: conic-gradient(from 0deg, #f472b6, #a78bfa, #38bdf8, #34d399, #fbbf24, #f472b6);
animation: gbb-spin var(--gbb-speed) linear infinite; }
.gbb-inner { position: relative; display: inline-flex; align-items: center; gap: .5rem;
padding: .65rem 1.4rem; border-radius: inherit; background: var(--gbb-glass);
backdrop-filter: blur(12px); color: var(--gbb-ink);
font-weight: 600; font-size: .92rem; line-height: 1.4;
transition: translate .25s ease; }
.gbb-inner small { font-weight: 400; opacity: .65; }
.gbb-btn:hover::before, .gbb-btn:focus-visible::before { animation-duration: 1s; }
.gbb-btn:hover .gbb-inner { translate: 0 -1px; }
.gbb-btn[data-size='lg'] .gbb-inner { padding: .9rem 1.9rem; font-size: 1.05rem; }
.gbb-btn[data-shape='rounded'] { border-radius: 14px; }
.gbb-btn[aria-pressed='true'] { padding: 2.5px; }
.gbb-btn:focus-visible .gbb-inner { outline: 2px solid #a78bfa; outline-offset: 2px; }
.gbb-regions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; justify-content: center; }
.gbb-dial { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
font-size: .85rem; color: #475569; }
.gbb-dial input[type='range'] { accent-color: #a78bfa; inline-size: 11rem; }
.gbb-status { margin: 0; font-size: .85rem; color: #475569; }
@keyframes gbb-spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .gbb-btn::before { animation: none; } }
</style>
// app/Pages/Edge.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 EdgeConsole from '@/components/EdgeConsole';
export default function Edge() {
return (
<NabuXUIProvider locale="en" linkComponent={Link}>
<main className="nx-page">
<EdgeConsole />
</main>
</NabuXUIProvider>
);
}
// EdgeConsole.jsx — the gradient border button: rotating conic ring,
// glass surface, region picking and a spin-speed dial
import { useState } from 'react';
import '@nabuxai/ui-core/css';
const REGIONS = [
{ id: 'eu-de-2', city: 'Frankfurt' },
{ id: 'eu-ie-1', city: 'Dublin' },
{ id: 'ap-se-1', city: 'Singapore' },
];
export default function EdgeConsole() {
const [speed, setSpeed] = useState(4);
const [region, setRegion] = useState('eu-de-2');
const [queued, setQueued] = useState(null);
return (
<>
<style>{`
.gbb { display: grid; gap: 1rem; justify-items: center;
--gbb-ink: #0f172a; --gbb-glass: rgba(255, 255, 255, .78); }
.gbb-btn { position: relative; overflow: hidden; padding: 1.5px; border: 0;
border-radius: 999px; background: transparent; cursor: pointer; }
.gbb-btn::before { content: ''; position: absolute; inset: -60%;
background: conic-gradient(from 0deg, #f472b6, #a78bfa, #38bdf8, #34d399, #fbbf24, #f472b6);
animation: gbb-spin var(--gbb-speed) linear infinite; }
.gbb-inner { position: relative; display: inline-flex; align-items: center; gap: .5rem;
padding: .65rem 1.4rem; border-radius: inherit; background: var(--gbb-glass);
backdrop-filter: blur(12px); color: var(--gbb-ink);
font: 600 .92rem/1.4 system-ui; transition: translate .25s ease; }
.gbb-inner small { font-weight: 400; opacity: .65; }
.gbb-btn:hover::before, .gbb-btn:focus-visible::before { animation-duration: 1s; }
.gbb-btn:hover .gbb-inner { translate: 0 -1px; }
.gbb-btn[data-size='lg'] .gbb-inner { padding: .9rem 1.9rem; font-size: 1.05rem; }
.gbb-btn[aria-pressed='true'] { padding: 2.5px; }
@keyframes gbb-spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .gbb-btn::before { animation: none; } }
`}</style>
<div className="gbb" style={{ '--gbb-speed': `${speed}s` }}>
<div className="gbb-dial">
<label htmlFor="gbb-speed">Ring speed</label>
<input id="gbb-speed" type="range" min="1" max="6" step="0.5" value={speed}
onChange={(e) => setSpeed(Number(e.target.value))} />
<output>{speed} s</output>
</div>
<button type="button" className="gbb-btn" data-size="lg" onClick={() => setQueued(region)}>
<span className="gbb-inner">Deploy the edge app</span>
</button>
<div className="gbb-regions" role="group" aria-label="Deploy region">
{REGIONS.map((r) => (
<button key={r.id} type="button" className="gbb-btn"
aria-pressed={region === r.id} onClick={() => setRegion(r.id)}>
<span className="gbb-inner">{r.city} <small>· {r.id}</small></span>
</button>
))}
</div>
{queued && (
<p className="gbb-status" role="status">Queued in {queued} — live in about 90 seconds.</p>
)}
</div>
</>
);
}
<!-- EdgeConsole.vue — the gradient border button: rotating conic ring,
glass surface, region picking and a spin-speed dial -->
<script setup lang="ts">
import { ref } from 'vue';
import '@nabuxai/ui-core/css';
const REGIONS = [
{ id: 'eu-de-2', city: 'Frankfurt' },
{ id: 'eu-ie-1', city: 'Dublin' },
{ id: 'ap-se-1', city: 'Singapore' },
];
const speed = ref(4);
const region = ref('eu-de-2');
const queued = ref<string | null>(null);
</script>
<template>
<div class="gbb" :style="{ '--gbb-speed': speed + 's' }">
<div class="gbb-dial">
<label for="gbb-speed">Ring speed</label>
<input id="gbb-speed" type="range" min="1" max="6" step="0.5" v-model.number="speed" />
<output>{{ speed }} s</output>
</div>
<button type="button" class="gbb-btn" data-size="lg" @click="queued = region">
<span class="gbb-inner">Deploy the edge app</span>
</button>
<div class="gbb-regions" role="group" aria-label="Deploy region">
<button v-for="r in REGIONS" :key="r.id" type="button" class="gbb-btn"
:aria-pressed="region === r.id" @click="region = r.id">
<span class="gbb-inner">{{ r.city }} <small>· {{ r.id }}</small></span>
</button>
</div>
<p v-if="queued" class="gbb-status" role="status">
Queued in {{ queued }} — live in about 90 seconds.
</p>
</div>
</template>
<style scoped>
.gbb { display: grid; gap: 1rem; justify-items: center;
--gbb-ink: #0f172a; --gbb-glass: rgba(255, 255, 255, .78); }
.gbb-btn { position: relative; overflow: hidden; padding: 1.5px; border: 0;
border-radius: 999px; background: transparent; cursor: pointer; }
.gbb-btn::before { content: ''; position: absolute; inset: -60%;
background: conic-gradient(from 0deg, #f472b6, #a78bfa, #38bdf8, #34d399, #fbbf24, #f472b6);
animation: gbb-spin var(--gbb-speed) linear infinite; }
.gbb-inner { position: relative; display: inline-flex; align-items: center; gap: .5rem;
padding: .65rem 1.4rem; border-radius: inherit; background: var(--gbb-glass);
backdrop-filter: blur(12px); color: var(--gbb-ink);
font: 600 .92rem/1.4 system-ui; transition: translate .25s ease; }
.gbb-inner small { font-weight: 400; opacity: .65; }
.gbb-btn:hover::before, .gbb-btn:focus-visible::before { animation-duration: 1s; }
.gbb-btn:hover .gbb-inner { translate: 0 -1px; }
.gbb-btn[data-size='lg'] .gbb-inner { padding: .9rem 1.9rem; font-size: 1.05rem; }
.gbb-btn[aria-pressed='true'] { padding: 2.5px; }
@keyframes gbb-spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .gbb-btn::before { animation: none; } }
</style>
<!-- EdgeConsole.svelte — the gradient border button: rotating conic ring,
glass surface, region picking and a spin-speed dial -->
<script lang="ts">
import '@nabuxai/ui-core/css';
const REGIONS = [
{ id: 'eu-de-2', city: 'Frankfurt' },
{ id: 'eu-ie-1', city: 'Dublin' },
{ id: 'ap-se-1', city: 'Singapore' },
];
let speed = $state(4);
let region = $state('eu-de-2');
let queued = $state<string | null>(null);
</script>
<div class="gbb" style={`--gbb-speed:${speed}s`}>
<div class="gbb-dial">
<label for="gbb-speed">Ring speed</label>
<input id="gbb-speed" type="range" min="1" max="6" step="0.5" bind:value={speed} />
<output>{speed} s</output>
</div>
<button type="button" class="gbb-btn" data-size="lg" onclick={() => (queued = region)}>
<span class="gbb-inner">Deploy the edge app</span>
</button>
<div class="gbb-regions" role="group" aria-label="Deploy region">
{#each REGIONS as r (r.id)}
<button type="button" class="gbb-btn" aria-pressed={region === r.id}
onclick={() => (region = r.id)}>
<span class="gbb-inner">{r.city} <small>· {r.id}</small></span>
</button>
{/each}
</div>
{#if queued}
<p class="gbb-status" role="status">Queued in {queued} — live in about 90 seconds.</p>
{/if}
</div>
<style>
.gbb { display: grid; gap: 1rem; justify-items: center;
--gbb-ink: #0f172a; --gbb-glass: rgba(255, 255, 255, .78); }
.gbb-btn { position: relative; overflow: hidden; padding: 1.5px; border: 0;
border-radius: 999px; background: transparent; cursor: pointer; }
.gbb-btn::before { content: ''; position: absolute; inset: -60%;
background: conic-gradient(from 0deg, #f472b6, #a78bfa, #38bdf8, #34d399, #fbbf24, #f472b6);
animation: gbb-spin var(--gbb-speed) linear infinite; }
.gbb-inner { position: relative; display: inline-flex; align-items: center; gap: .5rem;
padding: .65rem 1.4rem; border-radius: inherit; background: var(--gbb-glass);
backdrop-filter: blur(12px); color: var(--gbb-ink);
font: 600 .92rem/1.4 system-ui; transition: translate .25s ease; }
.gbb-inner small { font-weight: 400; opacity: .65; }
.gbb-btn:hover::before, .gbb-btn:focus-visible::before { animation-duration: 1s; }
.gbb-btn:hover .gbb-inner { translate: 0 -1px; }
.gbb-btn[data-size='lg'] .gbb-inner { padding: .9rem 1.9rem; font-size: 1.05rem; }
.gbb-btn[aria-pressed='true'] { padding: 2.5px; }
@keyframes gbb-spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .gbb-btn::before { animation: none; } }
</style>