Badge
Version Badge
A version number with its channel: monospaced figures and the channel spelled out — beta and alpha must not blur together.
- badge
- version
- release
- mono
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-008?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-008" (Version 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-008.json
Registry item: https://vibeui.ru/r/badge-008.json
Installs to: components/vibeui/badge-008.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 version number with its channel: monospaced figures and the channel spelled out — beta and alpha must not blur together.
A version badge: the number in a monospaced face and the release channel as a separate segment. Stable prints no channel at all. Zero dependencies, one file, no client JS.
## 3. How to use it
import { Badge008 } from "@/components/vibeui/badge-008"
<Badge008 version="v2.4.0" channel="beta" />
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-008-* palette — do not swap it for your theme tokens
- the monospaced number: proportional figures make the badge twitch on updates
- the channel as a word: beta and alpha carry different risk, colour blurs them
- no label on the stable channel — there is nothing to announce
- the divider between the segments instead of two separate badges
- the small type: a version is a detail, not a heading
## 6. You may change
- version — the number string
- channel — stable, beta or alpha
- the channel colours for your palette
- the radius and height to match neighbours
## 7. Rules
- The version is never parsed or compared: it is just a string.
- A changelog link belongs next to a beta: the badge explains nothing on its own.
- For a canary channel add a data-channel rule and remember the label.
- 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-008.jsonhttps://vibeui.ru/r/badge-008.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-badge-008-*. Серверный: хуков нет. Плашка состоит из двух частей: версия моноширинным шрифтом и канал заглавными, отделённый бордюром. Цвет канала выводится через color-mix из одной переменной. У стабильного канала вторая часть не рисуется вовсе — подписывать «stable» нечего.
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 Badge008Props = Omit<
ComponentPropsWithoutRef<"span">,
"children"
> & {
version?: string
channel?: "stable" | "beta" | "alpha"
}
// Идея компонента: номер версии рядом с названием. Цифры — моноширинным
// шрифтом, иначе «v1.11.0» и «v1.9.0» выглядят разной длины и прыгают при
// обновлении. Канал приписан словом: у беты и альфы разная цена ошибки, и
// одним цветом их путают.
const STYLES = `
:where([data-vibeui-block="badge-008"]){
--vibeui-badge-008-bg:oklch(0.96 0.004 265);
--vibeui-badge-008-fg:oklch(0.36 0.014 265);
--vibeui-badge-008-border:oklch(0.89 0.006 265);
--vibeui-badge-008-channel:oklch(0.55 0.014 265);
--vibeui-badge-008-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
--vibeui-badge-008-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="badge-008"]{
display:inline-flex;align-items:stretch;
height:1.5rem;overflow:hidden;
border:1px solid var(--vibeui-badge-008-border);border-radius:0.375rem;
background:var(--vibeui-badge-008-bg);color:var(--vibeui-badge-008-fg);
font-size:0.6875rem;line-height:1;vertical-align:middle;
}
[data-vibeui-block="badge-008"][data-channel="beta"]{--vibeui-badge-008-channel:oklch(0.6 0.16 265)}
[data-vibeui-block="badge-008"][data-channel="alpha"]{--vibeui-badge-008-channel:oklch(0.6 0.18 25)}
/* Версия моноширинным: пропорциональные цифры дёргают плашку при обновлении. */
[data-vibeui-block="badge-008"] [data-part="version"]{
display:inline-flex;align-items:center;padding:0 0.4375rem;
font-family:var(--vibeui-badge-008-mono);font-weight:600;letter-spacing:-0.01em;
}
[data-vibeui-block="badge-008"] [data-part="channel"]{
display:inline-flex;align-items:center;padding:0 0.4375rem;
border-left:1px solid var(--vibeui-badge-008-border);
background:color-mix(in oklab,var(--vibeui-badge-008-channel) 14%,oklch(1 0 0));
color:var(--vibeui-badge-008-channel);
font-family:var(--vibeui-badge-008-font);font-weight:700;
letter-spacing:0.04em;text-transform:uppercase;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="badge-008"] *{animation:none!important;transition:none!important}}
`
/**
* Номер версии с каналом: моноширинные цифры и подпись словом.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Badge008({
version = "v2.4.0",
channel = "beta",
className,
style,
...props
}: Badge008Props) {
return (
<>
<style href="vibeui-badge-008" precedence="medium">
{STYLES}
</style>
<span
{...props}
data-vibeui-block="badge-008"
data-channel={channel}
className={className}
style={style as CSSProperties}
>
<span data-part="version">{version}</span>
{channel === "stable" ? null : (
<span data-part="channel">{channel}</span>
)}
</span>
</>
)
}