Badge
Working Badge
A working badge: the ring spins, but the text is mandatory — a spinner alone never says what is happening or whether to wait.
- badge
- loading
- status
- progress
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/badge-012?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 "badge-012" (Working Badge) 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/badge-012.json
Registry item: https://vibeui.ru/r/badge-012.json
Installs to: components/vibeui/badge-012.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 working badge: the ring spins, but the text is mandatory — a spinner alone never says what is happening or whether to wait.
A badge for work in progress: a ring, the name of the action and an estimate of the time left. Zero dependencies, one file, no client JS.
## 3. How to use it
import { Badge012 } from "@/components/vibeui/badge-012"
<Badge012 label="Sending" hint="~20 s left" />
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 local --vibeui-badge-012-* palette — do not swap it for your theme tokens
- the mandatory text beside the ring: a spinner does not say what is running
- role="status" with aria-live: the start of the work has to be heard
- the time estimate — without it waiting reads as a freeze
- turning the ring into a dot under prefers-reduced-motion: the state matters more than the motion
- the ring built from borders instead of an image or a spinner package
## 6. You may change
- label — what is happening
- hint — how much is left
- the ring accent for your palette
- the badge height and radius
## 7. Rules
- Do not invent the estimate: "~20 s left" with no real calculation annoys more than silence.
- Work longer than a minute wants a progress bar, not a badge.
- When the work ends, replace the badge with the result rather than removing it silently.
- 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/badge-012.jsonhttps://vibeui.ru/r/badge-012.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-badge-012-*. Серверный: хуков нет. Кольцо собрано из бордюра с окрашенной верхней гранью и вращается keyframes. Плашка объявлена role="status" с aria-live="polite": появление процесса должно быть слышно. В prefers-reduced-motion кольцо превращается в залитую точку — состояние остаётся видимым, движение уходит.
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
import type { ComponentPropsWithoutRef, CSSProperties } from "react"
export type Badge012Props = Omit<
ComponentPropsWithoutRef<"span">,
"children"
> & {
label?: string
/** Сколько осталось: без оценки ожидание выглядит зависанием. */
hint?: string
}
// Идея компонента: плашка процесса. Кольцо крутится, но текст обязателен:
// один спиннер не отвечает, что именно происходит и стоит ли ждать. При
// prefers-reduced-motion вращение сменяется ровной точкой — состояние
// остаётся видимым, движение уходит.
const STYLES = `
:where([data-vibeui-block="badge-012"]){
--vibeui-badge-012-bg:oklch(0.96 0.004 265);
--vibeui-badge-012-fg:oklch(0.32 0.014 265);
--vibeui-badge-012-muted:oklch(0.55 0.014 265);
--vibeui-badge-012-track:oklch(0.86 0.008 265);
--vibeui-badge-012-accent:oklch(0.58 0.16 265);
--vibeui-badge-012-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="badge-012"]{
display:inline-flex;align-items:center;gap:0.4375rem;
height:1.625rem;padding:0 0.6875rem 0 0.5625rem;
border-radius:9999px;
background:var(--vibeui-badge-012-bg);color:var(--vibeui-badge-012-fg);
font-family:var(--vibeui-badge-012-font);font-size:0.75rem;font-weight:600;
line-height:1;white-space:nowrap;vertical-align:middle;
}
[data-vibeui-block="badge-012"] [data-part="spinner"]{
flex:none;width:0.6875rem;height:0.6875rem;box-sizing:border-box;
border:2px solid var(--vibeui-badge-012-track);
border-top-color:var(--vibeui-badge-012-accent);
border-radius:9999px;
animation:vibeui-badge-012-spin .7s linear infinite;
}
@keyframes vibeui-badge-012-spin{to{transform:rotate(360deg)}}
[data-vibeui-block="badge-012"] [data-part="hint"]{font-weight:500;color:var(--vibeui-badge-012-muted)}
/* Без движения состояние остаётся видимым: кольцо превращается в точку. */
@media (prefers-reduced-motion:reduce){
[data-vibeui-block="badge-012"] *{animation:none!important;transition:none!important}
[data-vibeui-block="badge-012"] [data-part="spinner"]{
border-color:var(--vibeui-badge-012-accent);background:var(--vibeui-badge-012-accent);
}
}
`
/**
* Плашка процесса: кольцо и обязательный текст, что происходит.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Badge012({
label = "Отправляем",
hint = "осталось ~20 с",
className,
style,
...props
}: Badge012Props) {
return (
<>
<style href="vibeui-badge-012" precedence="medium">
{STYLES}
</style>
<span
{...props}
data-vibeui-block="badge-012"
className={className}
style={style as CSSProperties}
role="status"
aria-live="polite"
>
<span data-part="spinner" aria-hidden="true" />
{label}
{hint ? <span data-part="hint">{hint}</span> : null}
</span>
</>
)
}