Badge
Compact inline marker for status, categories, and notification counts.
Basic
Variants
Color and variant matrix
Sizes
With icon
Add the icon class to <.icon> so the glyph scales with the badge's size token. Without it, the icon falls back to its native dimensions and breaks the row.
Leading, trailing, and icon-only
Place the icon before or after the label, or drop the label for compact markers. Add aria-label on icon-only badges so screen readers still announce the meaning.
Status dot
A <span> with bg-current picks up the badge's foreground color, so the dot stays in sync with the variant.
Notification counter
Combine variant="solid" with size="xs" for compact numeric markers next to a label.
Inside a button
Drop a badge inside a button to annotate the action. Use ghost or soft at xs to stay subtle next to the parent label.
Removable filter chips
Badges have no built-in interactive state. Wire them up with phx-click and add cursor-pointer to signal affordance.
Table cell status
| Invoice | Customer | Status | Amount |
|---|---|---|---|
| INV-1042 | Acme Inc. | paid | $2,400.00 |
| INV-1041 | Globex Co. | pending | $890.00 |
| INV-1040 | Initech | overdue | $1,250.00 |
| INV-1039 | Umbrella | draft | $0.00 |
Status next to a label
- Database
- Operational
- Queue worker
- Degraded
- Webhook delivery
- Failing
- CDN
- Operational
Custom classes
The class attribute merges with the variant, color, and size styles through Fluxon.ClassMerge; utilities you pass through win where they conflict.