Badge

Env Badge

An environment badge where the silhouette carries the meaning: production is a bevelled tag, staging a pill, development a dashed rectangle.

  • badge
  • environment
  • shape
  • devops

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.

put this in the header: https://vibeui.ru/c/badge-021?lang=en

prod
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-021" (Env 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-021.json

Registry item: https://vibeui.ru/r/badge-021.json
Installs to: components/vibeui/badge-021.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
An environment badge where the silhouette carries the meaning: production is a bevelled tag, staging a pill, development a dashed rectangle.

An environment badge in which prod, stage and dev differ by shape, not only by colour. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Badge021 } from "@/components/vibeui/badge-021"

<Badge021 env="stage" label="stage" />

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-021-* palette — do not swap it for your theme tokens
- the different shapes per environment: in a recompressed screenshot colour goes, the silhouette stays
- the missing border on prod: clip-path would cut the outline along with the corner and leave a ragged edge
- the monospace upper case: the badge must read as technical, not as a record status
- the loudest tone on prod — mistaking the environment costs the most
- the badge's own surface: without it the label is lost on any card

## 6. You may change
- the environment through env
- the caption through label
- the environment colours in the data-env rules
- the bevel size in the prod clip-path

## 7. Rules
- The caption is not derived from env: label is passed separately so wording stays a text question, not a code one.
- There are three environments: a fourth needs its own shape, or the "shape equals meaning" idea falls apart.
- clip-path cuts both background and shadow: do not give prod an outer shadow, it is clipped by the same contour.
- 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-021.json
https://vibeui.ru/r/badge-021.json

Один файл, ноль зависимостей, палитра в локальных переменных --vibeui-badge-021-*. Серверный: хуков нет. Атрибут data-env меняет не только цвета, но и форму: у prod clip-path срезает углы и рамка убирается (обводку всё равно срезало бы вместе с углом), у stage радиус уходит в пилюлю, у dev рамка становится пунктирной. Шрифт моноширинный и в верхнем регистре с разрядкой: метка окружения читается как техническая, а не как статус записи. На скриншоте в баг-репорте цвет теряется первым, а силуэт остаётся — перепутанное окружение стоит дороже любой другой ошибки метки.

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 Badge021Env = "prod" | "stage" | "dev"

export type Badge021Props = ComponentPropsWithoutRef<"span"> & {
  env?: Badge021Env
  label?: string
}

// Идея компонента: метка окружения, где смысл несёт форма. Боевое — плотный
// скошенный ярлык, предпродакшен — обычная пилюля, разработка — пунктирный
// прямоугольник. На скриншоте в баг-репорте цвет теряется первым, а силуэт
// остаётся: перепутанное окружение стоит дороже любой другой ошибки метки.
const STYLES = `
:where([data-vibeui-block="badge-021"]){
--vibeui-badge-021-bg:oklch(0.97 0.004 265);
--vibeui-badge-021-fg:oklch(0.36 0.014 265);
--vibeui-badge-021-border:oklch(0.86 0.008 265);
--vibeui-badge-021-font:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;
}
[data-vibeui-block="badge-021"]{
display:inline-flex;align-items:center;box-sizing:border-box;
height:1.5rem;padding:0 0.625rem;
border:1px solid var(--vibeui-badge-021-border);border-radius:0.25rem;
background:var(--vibeui-badge-021-bg);color:var(--vibeui-badge-021-fg);
font-family:var(--vibeui-badge-021-font);font-size:0.6875rem;font-weight:700;line-height:1;
letter-spacing:0.09em;text-transform:uppercase;vertical-align:middle;
}
/* Боевое: скошенный ярлык. Рамки нет — clip-path срезал бы её вместе с углом. */
[data-vibeui-block="badge-021"][data-env="prod"]{
--vibeui-badge-021-bg:oklch(0.5 0.18 25);
--vibeui-badge-021-fg:oklch(0.99 0.01 25);
border-color:transparent;border-radius:0;padding:0 0.875rem;
clip-path:polygon(0.4rem 0,100% 0,calc(100% - 0.4rem) 100%,0 100%);
}
/* Предпродакшен: обычная пилюля — промежуточная форма между двумя крайними. */
[data-vibeui-block="badge-021"][data-env="stage"]{
--vibeui-badge-021-bg:oklch(0.96 0.05 80);
--vibeui-badge-021-fg:oklch(0.42 0.09 70);
--vibeui-badge-021-border:oklch(0.85 0.09 80);
border-radius:9999px;
}
/* Разработка: пунктир, «ещё не настоящее». */
[data-vibeui-block="badge-021"][data-env="dev"]{
--vibeui-badge-021-bg:oklch(0.98 0.003 265);
--vibeui-badge-021-fg:oklch(0.48 0.014 265);
border-style:dashed;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="badge-021"] *{animation:none!important;transition:none!important}}
`

/**
 * Метка окружения: prod, stage и dev отличаются силуэтом, а не только цветом.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Badge021({
  env = "prod",
  label = "prod",
  className,
  style,
  ...props
}: Badge021Props) {
  return (
    <>
      <style href="vibeui-badge-021" precedence="medium">
        {STYLES}
      </style>
      <span
        {...props}
        data-vibeui-block="badge-021"
        data-env={env}
        className={className}
        style={style as CSSProperties}
      >
        {label}
      </span>
    </>
  )
}