Skip to content

Badge

The Badge component renders a small label used to categorise and annotate items — most commonly as tag badges, status indicators, and recipe labels.

Variants

Badges come in three families:

FamilyVariantsUse case
Hue solidorange, brown, green, teal, cyan, blue, indigo, purple, pink, roseTag category labels
Hue inverseorange-inverse, … rose-inverseSofter tag labels (light tint + coloured border)
Status solidok, warning, error, inactiveInventory status chips
Status inverseok-inverse, warning-inverse, error-inverse, inactive-inverseMuted status backgrounds
Importance solidprimary, secondary, destructive, neutralAction-relevant labels
Importance outlineprimary-outline, secondary-outline, destructive-outline, neutral-outlineLower-emphasis labels

Usage

import { Badge } from '@/components/ui/badge'
// Tag badges
<Badge variant="teal-inverse">Storage</Badge> // light tint
<Badge variant="orange">Category</Badge> // bold fill
// Status badges
<Badge variant="ok">In stock</Badge>
<Badge variant="warning">Low stock</Badge>
// Importance badges
<Badge variant="primary">New</Badge>

Name display convention

Tag names and recipe names in badges are displayed in title case using Tailwind’s capitalize class. Vendor badges explicitly add normal-case to override this behaviour because vendor names may use intentional casing (e.g. “iHerb”, “7-Eleven”).

Resources