Badge
Status Badge
A status badge where only the dot carries colour. Across twenty table rows the statuses stay findable without turning the table into a set of traffic lights.
- badge
- status
- label
- table
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-001?lang=en
Published
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-001" (Status 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-001.json
Registry item: https://vibeui.ru/r/badge-001.json
Installs to: components/vibeui/badge-001.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 status badge where only the dot carries colour. Across twenty table rows the statuses stay findable without turning the table into a set of traffic lights.
A status badge: neutral background, a coloured dot, a label. Five tones (neutral, success, warning, danger, info) change the dot alone, so a long list stays calm. Two sizes. Zero dependencies, one file, its own palette.
## 3. How to use it
import { Badge001 } from "@/components/vibeui/badge-001"
<Badge001 tone="success">Published</Badge001>
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-001-* palette — do not swap it for your theme tokens (bg-secondary, text-muted-foreground and the like)
- the core decision: the tone colours the dot, not the fill — filled tones turn a table into traffic lights
- the dot as a separate aria-hidden element: the text carries the meaning, the dot only helps find it
- the neutral background and border across every tone
- inline-flex and vertical-align:middle — the badge has to sit in a line of text without breaking it
- white-space:nowrap, otherwise a two-word status wraps inside the pill
- the <style> block inside the component — it holds the palette and the sizes
## 6. You may change
- the status text through children
- tone: neutral, success, warning, danger, info
- size: md in text and cards, sm in a dense table
- dot: turn it off when the badge is a tag rather than a status
- outer spacing through className
## 7. Rules
- Do not put a link or a button inside: this is a label, not a control.
- Never rely on the dot colour alone — the text is required, or neither a colour-blind reader nor a screen reader gets the status.
- 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-001.jsonhttps://vibeui.ru/r/badge-001.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-badge-001-*. Пять тонов переключаются data-атрибутом и меняют только переменную точки — фон и рамка остаются нейтральными во всех состояниях. Это inline-элемент: он встаёт в строку рядом с текстом и в ячейку таблицы.
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 Badge001Tone = "neutral" | "success" | "warning" | "danger" | "info"
export type Badge001Props = ComponentPropsWithoutRef<"span"> & {
tone?: Badge001Tone
/** Точка-индикатор слева. Без неё остаётся просто плашка с текстом. */
dot?: boolean
size?: "sm" | "md"
}
// Идея компонента: цвет несёт точка, а не вся плашка. В таблице из двадцати
// строк пять разноцветных заливок читаются как авария; нейтральная плашка с
// цветной точкой оставляет статус заметным, но не кричащим.
const STYLES = `
:where([data-vibeui-block="badge-001"]){
--vibeui-badge-001-fg:oklch(0.32 0.014 265);
--vibeui-badge-001-bg:oklch(0.96 0.004 265);
--vibeui-badge-001-border:oklch(0.89 0.006 265);
--vibeui-badge-001-dot:oklch(0.62 0.014 265);
--vibeui-badge-001-radius:9999px;
--vibeui-badge-001-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="badge-001"]{
display:inline-flex;align-items:center;gap:0.4375rem;
height:1.5rem;padding:0 0.625rem;
border:1px solid var(--vibeui-badge-001-border);
border-radius:var(--vibeui-badge-001-radius);
background:var(--vibeui-badge-001-bg);color:var(--vibeui-badge-001-fg);
font-family:var(--vibeui-badge-001-font);font-size:0.75rem;font-weight:500;
line-height:1;white-space:nowrap;vertical-align:middle;
}
[data-vibeui-block="badge-001"][data-size="sm"]{height:1.25rem;padding:0 0.5rem;font-size:0.6875rem;gap:0.375rem}
[data-vibeui-block="badge-001"] [data-part="dot"]{
width:0.375rem;height:0.375rem;flex:none;border-radius:9999px;
background:var(--vibeui-badge-001-dot);
}
[data-vibeui-block="badge-001"][data-size="sm"] [data-part="dot"]{width:0.3125rem;height:0.3125rem}
[data-vibeui-block="badge-001"][data-tone="success"]{--vibeui-badge-001-dot:oklch(0.63 0.17 152)}
[data-vibeui-block="badge-001"][data-tone="warning"]{--vibeui-badge-001-dot:oklch(0.75 0.16 75)}
[data-vibeui-block="badge-001"][data-tone="danger"]{--vibeui-badge-001-dot:oklch(0.58 0.2 25)}
[data-vibeui-block="badge-001"][data-tone="info"]{--vibeui-badge-001-dot:oklch(0.58 0.18 262)}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="badge-001"] *{animation:none!important;transition:none!important}}
`
/**
* Статусная плашка, в которой цвет несёт только точка.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Badge001({
tone = "success",
dot = true,
size = "md",
className,
style,
children = "Опубликовано",
...props
}: Badge001Props) {
return (
<>
<style href="vibeui-badge-001" precedence="medium">
{STYLES}
</style>
<span
{...props}
data-vibeui-block="badge-001"
data-tone={tone}
data-size={size}
className={className}
style={style as CSSProperties}
>
{dot ? <span data-part="dot" aria-hidden="true" /> : null}
{children}
</span>
</>
)
}