Badge
Stage Badge
A document stage with a shape mark: ring, half-fill, solid and struck through — readable without colour.
- badge
- stage
- workflow
- a11y
Preview
1440pxHost theme
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-006?lang=en
In review
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-006" (Stage 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-006.json
Registry item: https://vibeui.ru/r/badge-006.json
Installs to: components/vibeui/badge-006.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 document stage with a shape mark: ring, half-fill, solid and struck through — readable without colour.
A document-stage badge: draft, review, live and archived differ by the shape of the mark, not only by colour. Zero dependencies, one file, no client JS.
## 3. How to use it
import { Badge006 } from "@/components/vibeui/badge-006"
<Badge006 stage="review" />
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-006-* palette — do not swap it for your theme tokens
- shape as the primary cue: colour disappears in print and for colour-blind readers
- the word next to the mark — the mark qualifies the name, it does not replace it
- marks built from borders and a gradient instead of an icon package
- the muted archived stage: it must not compete with live ones
- the stage as a data-stage attribute rather than a set of components
## 6. You may change
- stage — draft, review, live or archived
- label — your own stage wording
- the mark colours for your palette
- the stage names in the table
## 7. Rules
- Four stages ship: a fifth is a data-stage rule plus a line in the label table.
- Do not use the badge as a stage switcher: changing state deserves an explicit action.
- In dense tables badge-001 with a dot is wiser: marks eat width.
- 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-006.jsonhttps://vibeui.ru/r/badge-006.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-badge-006-*. Серверный: хуков нет. Стадия переключается атрибутом data-stage: у каждой свой знак — пустой круг, наполовину залитый градиентом, залитый и перечёркнутый псевдоэлементом. Цвет только усиливает форму. Подпись берётся из таблицы стадий и переопределяется пропом label.
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 Badge006Stage = "draft" | "review" | "live" | "archived"
export type Badge006Props = Omit<
ComponentPropsWithoutRef<"span">,
"children"
> & {
stage?: Badge006Stage
label?: string
}
// Идея компонента: стадия документа со своим знаком. У каждой стадии свой
// значок — круг, полукруг, залитый круг, перечёркнутый — поэтому она читается
// и в чёрно-белой печати, и при дальтонизме. Значки собраны из бордюров и
// градиента, без иконочного пакета.
const STYLES = `
:where([data-vibeui-block="badge-006"]){
--vibeui-badge-006-bg:oklch(0.96 0.004 265);
--vibeui-badge-006-fg:oklch(0.32 0.014 265);
--vibeui-badge-006-border:oklch(0.89 0.006 265);
--vibeui-badge-006-mark:oklch(0.55 0.014 265);
--vibeui-badge-006-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="badge-006"]{
display:inline-flex;align-items:center;gap:0.4375rem;
height:1.5rem;padding:0 0.625rem;
border:1px solid var(--vibeui-badge-006-border);border-radius:0.4375rem;
background:var(--vibeui-badge-006-bg);color:var(--vibeui-badge-006-fg);
font-family:var(--vibeui-badge-006-font);font-size:0.75rem;font-weight:600;
line-height:1;white-space:nowrap;vertical-align:middle;
}
[data-vibeui-block="badge-006"][data-stage="review"]{--vibeui-badge-006-mark:oklch(0.72 0.16 75)}
[data-vibeui-block="badge-006"][data-stage="live"]{--vibeui-badge-006-mark:oklch(0.6 0.17 152)}
[data-vibeui-block="badge-006"][data-stage="archived"]{--vibeui-badge-006-mark:oklch(0.66 0.012 265);color:oklch(0.5 0.014 265)}
/* Форма знака несёт стадию: цвет только усиливает, но не заменяет её. */
[data-vibeui-block="badge-006"] [data-part="mark"]{
position:relative;flex:none;width:0.625rem;height:0.625rem;
border:1.5px solid var(--vibeui-badge-006-mark);border-radius:9999px;
}
[data-vibeui-block="badge-006"][data-stage="review"] [data-part="mark"]{
background:linear-gradient(to right,var(--vibeui-badge-006-mark) 50%,transparent 50%);
}
[data-vibeui-block="badge-006"][data-stage="live"] [data-part="mark"]{background:var(--vibeui-badge-006-mark)}
[data-vibeui-block="badge-006"][data-stage="archived"] [data-part="mark"]::after{
content:"";position:absolute;left:-0.0625rem;right:-0.0625rem;top:50%;
height:1.5px;margin-top:-0.75px;background:var(--vibeui-badge-006-mark);
transform:rotate(-45deg);
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="badge-006"] *{animation:none!important;transition:none!important}}
`
const STAGE_TEXT: Record<Badge006Stage, string> = {
draft: "Черновик",
review: "На проверке",
live: "Опубликован",
archived: "В архиве",
}
/**
* Стадия документа со знаком-формой: читается и без цвета.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Badge006({
stage = "review",
label,
className,
style,
...props
}: Badge006Props) {
return (
<>
<style href="vibeui-badge-006" precedence="medium">
{STYLES}
</style>
<span
{...props}
data-vibeui-block="badge-006"
data-stage={stage}
className={className}
style={style as CSSProperties}
>
<span data-part="mark" aria-hidden="true" />
{label ?? STAGE_TEXT[stage]}
</span>
</>
)
}