Weftv0.4.0
GitHubFigma
Blade AI
Display · Badgestable

Badge

A short, non-interactive label for the status of an item or a small piece of metadata. Six intents, subtle or intense emphasis, three sizes.

Preview

#preview

Change the options and the code follows. Show code opens the React snippet.

badge-example.tsx
import { Badge } from "@blade-ai/weft/components/badge";

<Badge>Completed</Badge>

All states

#all-states

Subtle and intense emphasis in every intent, from the Badge artboard.

Badge · 6 intents × 2 emphasis · 3 sizes
subtle · neutral
subtle · positive
subtle · negative
subtle · notice
subtle · information
Badge
subtle · primary
intense · neutral
intense · positive
intense · negative
intense · notice
intense · information
Badge
intense · primary
size = sm
size = md
size = lg

Props

#props

Read from the component source. Booleans are is-prefixed. A star marks a required prop.

Prop
Type
Default
Description
children *
ReactNode
—
Short status text.
size
"sm" | "md" | "lg"
"md"
Height 18 / 20 / 24px.
intent
"neutral" | "positive" | "negative" | "notice" | "information" | "primary"
"neutral"
Meaning of the badge; sets colour.
emphasis
"subtle" | "intense"
"subtle"
"subtle" is a tinted surface; "intense" is a solid fill.

Usage

#usage

Short rules for choosing and writing badge.

Do
Map each status to one colour across the product: Completed is positive, Pending is notice, Failed is negative.
Keep labels to one or two words.
Use subtle emphasis by default and keep intense for the one status that must stand out.
Don't
Pick colours for decoration or variety.
Rely on colour alone; the text must carry the meaning.
Make a badge clickable; use a Tag or Button instead.

Accessibility

#accessibility

A badge is a span read in reading order, placed right after what it describes.

ARIA
Element
Role / attribute
When
Badge
span, no role
Not focusable. In a table, the column header gives the context.
Live updates
aria-live="polite" on a parent
Announce changes such as Pending to Completed yourself; the badge does not.
Colour
text label
All colour pairs meet 4.5:1 in light and dark.