Components
Badge
A small static label for a status or a fact, such as a role’s fit or a skill.
DraftIn reviewGood fitNeeds infoNot a fit
import { Badge } from '@dex/shared/components/badge'
export function BadgeTones() {
return (
<>
<Badge>Draft</Badge>
<Badge tone="info">In review</Badge>
<Badge tone="success">Good fit</Badge>
<Badge tone="warning">Needs info</Badge>
<Badge tone="danger">Not a fit</Badge>
</>
)
}
InactiveReadyActivePendingMissing CV
import { Badge } from '@dex/shared/components/badge'
export function BadgeDot() {
return (
<>
<Badge variant="dot">Inactive</Badge>
<Badge tone="info" variant="dot">
Ready
</Badge>
<Badge tone="success" variant="dot">
Active
</Badge>
<Badge tone="warning" variant="dot">
Pending
</Badge>
<Badge tone="danger" variant="dot">
Missing CV
</Badge>
</>
)
}
NewBetaHiredCloses todayUrgent
import { Badge } from '@dex/shared/components/badge'
export function BadgeSolid() {
return (
<>
<Badge variant="solid">New</Badge>
<Badge tone="info" variant="solid">
Beta
</Badge>
<Badge tone="success" variant="solid">
Hired
</Badge>
<Badge tone="warning" variant="solid">
Closes today
</Badge>
<Badge tone="danger" variant="solid">
Urgent
</Badge>
</>
)
}
TypeScriptSeries BHybrid, 2 daysTerraform
import { Badge } from '@dex/shared/components/badge'
export function BadgeOutline() {
return (
<>
<Badge size="lg" variant="outline">
TypeScript
</Badge>
<Badge size="lg" variant="outline">
Series B
</Badge>
<Badge size="lg" variant="outline">
Hybrid, 2 days
</Badge>
<Badge muted size="lg" variant="outline">
Terraform
</Badge>
</>
)
}
ActiveActiveActiveTypeScriptTypeScriptTypeScript
import { Badge } from '@dex/shared/components/badge'
export function BadgeSizes() {
return (
<>
<Badge size="sm" tone="success" variant="dot">
Active
</Badge>
<Badge tone="success" variant="dot">
Active
</Badge>
<Badge size="lg" tone="success" variant="dot">
Active
</Badge>
<Badge size="sm" variant="outline">
TypeScript
</Badge>
<Badge variant="outline">TypeScript</Badge>
<Badge size="lg" variant="outline">
TypeScript
</Badge>
</>
)
}
Good fit Needs info Role closed London
import { Check, CircleHelp, MapPin, X } from 'lucide-react'
import { Badge } from '@dex/shared/components/badge'
export function BadgeWithIcon() {
return (
<>
<Badge tone="success">
<Check aria-hidden /> Good fit
</Badge>
<Badge tone="warning">
<CircleHelp aria-hidden /> Needs info
</Badge>
<Badge tone="danger">
<X aria-hidden /> Role closed
</Badge>
<Badge variant="outline" size="lg">
<MapPin aria-hidden /> London
</Badge>
</>
)
}
Matchmaker 28 Nov Approved Jack MoneyLondon Hybrid
import { CircleCheck, Sparkles } from 'lucide-react'
import { Badge, BadgeDivider } from '@dex/shared/components/badge'
export function BadgeSplit() {
return (
<>
<Badge variant="outline">
<Sparkles aria-hidden /> Matchmaker <BadgeDivider /> 28 Nov
</Badge>
<Badge tone="success">
<CircleCheck aria-hidden /> Approved <BadgeDivider /> Jack Money
</Badge>
<Badge size="sm" variant="outline">
London <BadgeDivider /> Hybrid
</Badge>
</>
)
}
import Link from 'next/link'
import { Badge } from '@dex/shared/components/badge'
export function BadgeAsLink() {
return (
<>
<Badge variant="outline" size="lg" render={<Link href="/components/badge" />}>
Series B
</Badge>
<Badge size="lg" render={<Link href="/components/badge" />}>
Fintech
</Badge>
</>
)
}
- A badge is a static label: a status, a fact, a skill. It is never pressed. Something a person can press or remove is a chip, and a number on its own is a count.
- Two options carry the meaning.
tonesays what it means:neutral,info,success,warningordanger.variantsays how loudly:subtleby default,dot,solidoroutline. - When a badge needs a second fact that belongs with the first, such as a source and its date, put
<BadgeDivider />between them rather than two badges side by side. Once per badge: three parts are a row of text. - An icon in a small badge is drawn with a 1px line, not the usual 1.25px: at that size the usual line runs a detailed icon together. The badge does this itself.
- Keep a tone for a real status, and give the same status the same tone everywhere. Never orange: the brand colour is not a status.
- Colour is never the only signal. The words say what the status is, so the badge still reads in black and white.
dotis for a status in a table or a dense list, where toned text on every row would be loud.solidis for the one thing on a screen that must not be missed.outlineis the tag for skills, facts and other metadata. It has no tone.mutedquietens a neutral badge's text, for a value that matters less than the ones beside it. Use an option, not a class: a badge is never restyled with colour, height or weight classes.- One or two words in sentence case, as an adjective or past tense: "Archived", not "Archive", so it does not read as a button.
- Use one size in a group:
smin a dense table,mdby default,lgfor tags beside body text. - An icon inside is drawn at 12px, or 14px at
lg. Give itaria-hidden, since the label already says it.