Badge
A small label for a status, category or count.
JavaScript off: what the HTML and CSS do on their own.
A small label for a status, category or count.
Usage
<Badge Status="Status.Success">Published</Badge>
<Badge Status="Status.Danger" Variant="BadgeVariant.Solid" Pill>3</Badge>
<Badge Status="Status.Warning" Dot>Pending review</Badge>
<Badge Accent="Accent.Primary" Variant="BadgeVariant.Solid" Pill>12</Badge>Status
Use Status for what the badge means, or Accent for a color of your own.
Preview
Draft
Beta
Paid
Pending
Failed
Pro
Code
<Row Gap="2" Align="Align.Center" Wrap Justify="Justify.Center">
<Badge>Draft</Badge>
<Badge Status="Status.Info">Beta</Badge>
<Badge Status="Status.Success">Paid</Badge>
<Badge Status="Status.Warning">Pending</Badge>
<Badge Status="Status.Danger">Failed</Badge>
<Badge Accent="Accent.Primary">Pro</Badge>
</Row>Variants
Use Variant for the weight: Soft (the default), Solid, Outline or Plain.
Preview
Active
Active
Active
Active
Code
<Row Gap="2" Align="Align.Center" Wrap Justify="Justify.Center">
<Badge Status="Status.Success">Active</Badge>
<Badge Status="Status.Success" Variant="BadgeVariant.Solid">Active</Badge>
<Badge Status="Status.Success" Variant="BadgeVariant.Outline">Active</Badge>
<Badge Status="Status.Success" Variant="BadgeVariant.Plain">Active</Badge>
</Row>Dots, counts and icons
Use Dot for a status, Pill for a count and StartIcon for an icon before the text.
Preview
Published
In review
New
3
12
Code
<Row Gap="3" Align="Align.Center" Wrap Justify="Justify.Center">
<Badge Status="Status.Success" Dot>Published</Badge>
<Badge Status="Status.Warning" Dot>In review</Badge>
<Badge Status="Status.Info" StartIcon="Lucide.Sparkles">New</Badge>
<Badge Status="Status.Danger" Variant="BadgeVariant.Solid" Pill>3</Badge>
<Badge Accent="Accent.Primary" Variant="BadgeVariant.Solid" Pill Size="BadgeSize.Sm">12</Badge>
</Row>In headings and buttons
Use Size="BadgeSize.Sm" for a count inside a button; a badge sits inline, so it fits a heading too.
Preview
Release notes v2.4
Code
<Stack Gap="3" Align="Align.Center">
<Heading Level="3" Size="TextSize.Lg">Release notes <Badge Accent="Accent.Primary">v2.4</Badge></Heading>
<Button Variant="ButtonVariant.Outline" Accent="Accent.Neutral" StartIcon="Lucide.Inbox">
Inbox <Badge Accent="Accent.Primary" Variant="BadgeVariant.Solid" Pill Size="BadgeSize.Sm">4</Badge>
</Button>
</Stack>Mode support
| Feature | Off | Static | Live |
|---|---|---|---|
| Everything | Yes | Yes | Yes |
Off: JavaScript disabled. Static: a static SSR page with IzzyBlazor's script. Live: an interactive page (Server, WebAssembly or Auto).
Accessibility
Parameters
| Prop | Type | Default |
|---|---|---|
StatusWhat the badge means. | Status | Status.Neutral |
AccentA color in place of Status's, such as Accent.Primary for a brand-colored count, Accent.Of("#0d9488") or Accent.Token("brand"). | Accent? | |
VariantVisual weight. | BadgeVariant | BadgeVariant.Soft |
SizeSize. | BadgeSize | BadgeSize.Md |
PillFully rounded ends, for counts. | bool | false |
DotA colored dot before the text, for statuses. | bool | false |
StartIconAn icon before the text. | IconData? | |
ChildContentThe text. | RenderFragment? |
Plus 16 item props and 4 common props.
Full API