Badge
A badge names a state in a word or two, such as Live, Draft or 3 new. Its tone picks the colour from the theme, so the same word reads the same on every screen. It is a label, not a control; to act on something, use a button.
Tones
A tone gives the badge its meaning; the words carry it too.
LiveTrialDue soonOverdue
Badge { text: "Live".into(), tone: Tone::Ok }.html(out);
Badge { text: "Trial".into(), tone: Tone::Info }.html(out);
Badge { text: "Due soon".into(), tone: Tone::Warn }.html(out);
Badge { text: "Overdue".into(), tone: Tone::Bad }.html(out);Neutral and brand
Neutral for counts and tags, brand for the product's own label.
12 tagsNew
Badge { text: "12 tags".into(), tone: Tone::Neutral }.html(out);
Badge { text: "New".into(), tone: Tone::Brand }.html(out);Beside a title
A badge qualifies what it sits next to.
Acme renewal Pilot
out.push_str("<b>Acme renewal</b> ");
Badge { text: "Pilot".into(), tone: Tone::Info }.html(out);On the Mac
The same vocabulary drawn by Ocean UI's native face (egui on Metal), as the gallery's snapshot.


Use it
Web
use ocean_ui_core::{Badge, Tone};
Badge { text: "Live".into(), tone: Tone::Ok }Native
use ocean_ui_native::{Show, core::{Badge, Tone}};
Badge { text: "Deployed".into(), tone: Tone::Ok }.show(ui);Cargo feature base of ocean-ui-core, ocean-ui-web and ocean-ui-native; available since 2026-10-29.
In App UI, the grid block draws it from YAML.
Props
| Name | Type | Default | What |
|---|---|---|---|
text | String | — | The words in the pill, short and in sentence case. |
tone | Tone | Neutral | Neutral, Ok, Warn, Bad, Info or Brand: what the label means. |
Accessibility
- The badge is a span of plain text, so a screen reader reads its words in place.
- The tone is colour only, so the words must carry the meaning on their own.
- It takes no focus and no clicks.
Related
Markdown
The same page as Markdown, for an agent or a pull request.
# Badge
A short label in a pill, coloured by its tone, for a state or a count beside a title.
A badge names a state in a word or two, such as Live, Draft or 3 new. Its tone picks the colour from the theme, so the same word reads the same on every screen. It is a label, not a control; to act on something, use a button.
## Use it
Web:
```rust
use ocean_ui_core::{Badge, Tone};
Badge { text: "Live".into(), tone: Tone::Ok }
```
Native:
```rust
use ocean_ui_native::{Show, core::{Badge, Tone}};
Badge { text: "Deployed".into(), tone: Tone::Ok }.show(ui);
```
Cargo feature `base`; since 2026-10-29.
In App UI the `grid` block draws it ([grid](/ui/blocks/grid.md)).
## Props
| Name | Type | Default | What |
|---|---|---|---|
| `text` | `String` | `—` | The words in the pill, short and in sentence case. |
| `tone` | `Tone` | `Neutral` | Neutral, Ok, Warn, Bad, Info or Brand: what the label means. |
On the Mac:  
## Examples
### Tones
A tone gives the badge its meaning; the words carry it too.
```rust
Badge { text: "Live".into(), tone: Tone::Ok }.html(out);
Badge { text: "Trial".into(), tone: Tone::Info }.html(out);
Badge { text: "Due soon".into(), tone: Tone::Warn }.html(out);
Badge { text: "Overdue".into(), tone: Tone::Bad }.html(out);
```
### Neutral and brand
Neutral for counts and tags, brand for the product's own label.
```rust
Badge { text: "12 tags".into(), tone: Tone::Neutral }.html(out);
Badge { text: "New".into(), tone: Tone::Brand }.html(out);
```
### Beside a title
A badge qualifies what it sits next to.
```rust
out.push_str("<b>Acme renewal</b> ");
Badge { text: "Pilot".into(), tone: Tone::Info }.html(out);
```
## Accessibility
- The badge is a span of plain text, so a screen reader reads its words in place.
- The tone is colour only, so the words must carry the meaning on their own.
- It takes no focus and no clicks.
## Related
- [Status](/ui/components/status.md)
- [KPI](/ui/components/kpi.md)
- [Grid](/ui/components/grid.md)