Badge
A small label for status indicators, counts, or categories.
Preview
Rendered in WASM — scroll may behave differently from the rest of the pageUsage
rust
use ui_theme::components::badge::{badge, BadgeVariant};
badge(ui, &theme, "Active", BadgeVariant::Primary);
badge(ui, &theme, "New", BadgeVariant::Accent); Props
| Prop | Type | Default | Description |
|---|---|---|---|
ui | &mut Ui | required | The egui UI context |
theme | &Theme | required | Theme instance |
label | &str | required | Badge text |
variant | BadgeVariant | Primary | Visual variant |
Variants
| Variant | Description |
|---|---|
Primary | Default blue |
Accent | Uses ring color |
Outline | Border only |
Destructive | Red for warnings |