vaiperui

components / badge

Badge

Small status label with semantic colors and an optional dot.

How to use

Use `status` for the semantic color and `dot` for a decorative indicator. It is not interactive. Color must not be the only signal, so the text should state the status. For categories or filters use `Tag`.

preview
ActiveAttentionRefused
Badge.tsx
import { Badge } from "vaiperui";
<Badge status="success" dot>Active</Badge>
<Badge status="warning">Attention</Badge>

Statuses

preview
success
success
error
error
warning
warning
info
info
neutral
neutral
pending
pending
statuses.tsx
<Badge status="success">success</Badge>
<Badge status="error">error</Badge>
<Badge status="warning">warning</Badge>
<Badge status="info">info</Badge>
<Badge status="neutral">neutral</Badge>
<Badge status="pending">pending</Badge>

With dot

preview
success
success
error
error
warning
warning
info
info
neutral
neutral
pending
pending
dot.tsx
<Badge status="success" dot>success</Badge>
<Badge status="error" dot>error</Badge>
<Badge status="warning" dot>warning</Badge>
<Badge status="info" dot>info</Badge>
<Badge status="neutral" dot>neutral</Badge>
<Badge status="pending" dot>pending</Badge>

Sizes

preview
sm
sm
md
md
lg
lg
sizes.tsx
<Badge size="sm">sm</Badge>
<Badge size="md">md</Badge>
<Badge size="lg">lg</Badge>

Custom color

preview
Orange
Orange
Orange
Violet
custom-color.tsx
<Badge customColor="#ff6600" />
<Badge customColor={{ light: "#a855f7", dark: "#fde047" }} />

Props

PropValuesDefaultDescription
statussuccess | error | warning | info | neutral | pendingneutralSemantic color
dotbooleanfalseDecorative dot before the text
sizesm | md | lgmdSize of the element and its text
radiusnone | sm | md | lg | fullfullCorner rounding
customColorstring | { light, dark }noneAny CSS color (or a pair per theme) for the badge (overrides status)
(native)spannoneEvery native prop of the element, className, ref, etc.