Buttons
Running Border Button
A bright sector runs around the button's border: a rotating conic-gradient in the backing plate, of which only a border-thin strip stays visible.
- button
- border
- animated
- conic-gradient
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this in the header: https://vibeui.ru/c/button-044?lang=en
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
# Install and place "button-044" (Running Border Button) from VibeUI
## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/button-044.json
Registry item: https://vibeui.ru/r/button-044.json
Installs to: components/vibeui/button-044.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.
Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.
## 2. What it is
A bright sector runs around the button's border: a rotating conic-gradient in the backing plate, of which only a border-thin strip stays visible.
A dark button with a bright sector running around its edge. The trick: a rotating conic-gradient sits in the backing plate, and the opaque button on top leaves only a pixel-and-a-half border of it. The revolution speed is a prop. Under prefers-reduced-motion the rotation stops while the gradient stays on the border. Zero dependencies, one file.
## 3. How to use it
import { Button044 } from "@/components/vibeui/button-044"
<Button044 speed={4} onClick={stop}>Generating</Button044>
Read the installed file for the full prop list.
## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.
Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)
## 5. Keep exactly as installed
- the 220%-wide square: a smaller one does not cover the diagonal and the sector tears at the corners
- overflow:hidden on the wrapper — without it the rotating square spills outside the button
- the opaque background of the inner button: that is what turns the sector into a border
- the wrapper's padding as the border weight — one number in one place
- the prefers-reduced-motion rule, which stops the rotation without removing the gradient
- the inner radius computed as the wrapper radius minus the border weight: otherwise the corners drift apart
## 6. You may change
- the label
- the revolution time through the speed prop, in seconds
- the running sector's colour through the accent prop
- the onClick handler and disabled
- the inner surface colour through the --vibeui-button-044-inner variable
## 7. Rules
- Do not leave the running border on an idle button: motion along the edge reads as work in progress and lies without it.
- Do not set speed below two seconds: a fast revolution turns into flicker and tires the eye.
- Do not zero out the wrapper padding — the border disappears and takes the effect with it.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.
## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.For developers
npx shadcn@latest add https://vibeui.ru/r/button-044.jsonhttps://vibeui.ru/r/button-044.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-button-044-*. Серверный компонент. Корень блока — обёртка с padding 1.5px и overflow:hidden; её псевдоэлемент — квадрат в 220% ширины с conic-gradient, который крутится анимацией. Поверх лежит кнопка с непрозрачным фоном, поэтому от сектора остаётся только рамка. Размер 220% не случаен: меньший квадрат не покрывает диагональ, и сектор рвётся на углах. Скорость оборота — проп speed в секундах.
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
import type {
ComponentPropsWithoutRef,
CSSProperties,
MouseEventHandler,
ReactNode,
} from "react"
export type Button044Props = Omit<
ComponentPropsWithoutRef<"div">,
"children" | "onClick"
> & {
children?: ReactNode
/** Полный оборот бегунка в секундах. */
speed?: number
disabled?: boolean
onClick?: MouseEventHandler<HTMLButtonElement>
accent?: string
}
// Идея компонента: по рамке бежит светлый сектор. Приём — вращающийся
// conic-gradient в подложке-обёртке, поверх которого лежит внутренняя
// поверхность: видимой остаётся только полоска толщиной в рамку. Вращается
// квадрат со стороной больше диагонали, иначе на углах сектор рвётся.
const STYLES = `
:where([data-vibeui-block="button-044"]){
--vibeui-button-044-speed:4s;
--vibeui-button-044-accent:oklch(0.72 0.19 155);
--vibeui-button-044-track:oklch(0.32 0.02 265);
--vibeui-button-044-inner:oklch(0.22 0.02 265);
--vibeui-button-044-fg:oklch(0.97 0.01 265);
--vibeui-button-044-radius:0.75rem;
--vibeui-button-044-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="button-044"]{
position:relative;display:inline-flex;overflow:hidden;
padding:1.5px;border-radius:var(--vibeui-button-044-radius);
background:var(--vibeui-button-044-track);
font-family:var(--vibeui-button-044-font);
isolation:isolate;
}
[data-vibeui-block="button-044"]::before{
content:"";position:absolute;left:50%;top:50%;
width:220%;aspect-ratio:1;z-index:0;
background:conic-gradient(from 0deg,transparent 0 62%,var(--vibeui-button-044-accent) 78%,transparent 88%);
animation:vibeui-button-044-run var(--vibeui-button-044-speed) linear infinite;
}
@keyframes vibeui-button-044-run{
from{transform:translate(-50%,-50%) rotate(0deg)}
to{transform:translate(-50%,-50%) rotate(360deg)}
}
[data-vibeui-block="button-044"] [data-part="button"]{
position:relative;z-index:1;
appearance:none;border:0;cursor:pointer;box-sizing:border-box;
display:inline-flex;align-items:center;gap:0.5rem;
height:2.625rem;padding:0 1.125rem;
border-radius:calc(var(--vibeui-button-044-radius) - 1.5px);
background:var(--vibeui-button-044-inner);color:var(--vibeui-button-044-fg);
font:inherit;font-size:0.875rem;font-weight:650;line-height:1;
transition:background-color .16s ease;
}
[data-vibeui-block="button-044"] [data-part="button"]:hover:not(:disabled){
background:color-mix(in oklab,var(--vibeui-button-044-inner) 88%,white);
}
[data-vibeui-block="button-044"] [data-part="button"]:focus-visible{
outline:2px solid var(--vibeui-button-044-accent);outline-offset:3px;
}
[data-vibeui-block="button-044"] [data-part="button"]:disabled{cursor:not-allowed;opacity:.55}
[data-vibeui-block="button-044"] [data-part="pulse"]{
flex:none;width:0.5rem;height:0.5rem;border-radius:50%;
background:var(--vibeui-button-044-accent);
box-shadow:0 0 0 3px color-mix(in oklab,var(--vibeui-button-044-accent) 22%,transparent);
}
@media (prefers-reduced-motion:reduce){
[data-vibeui-block="button-044"] *{animation:none!important;transition:none!important}
[data-vibeui-block="button-044"]::before{animation:none!important;transform:translate(-50%,-50%) rotate(45deg)}
}
`
/**
* Кнопка с бегущей рамкой: сектор conic-gradient крутится под поверхностью.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Button044({
children = "Идёт генерация",
speed = 4,
disabled,
onClick,
accent,
className,
style,
...props
}: Button044Props) {
const palette = {
"--vibeui-button-044-speed": `${speed}s`,
...(accent ? { "--vibeui-button-044-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-button-044" precedence="medium">
{STYLES}
</style>
<div
{...props}
data-vibeui-block="button-044"
className={className}
style={palette}
>
<button
type="button"
data-part="button"
disabled={disabled}
onClick={onClick}
>
<span data-part="pulse" aria-hidden="true" />
{children}
</button>
</div>
</>
)
}