iced-cube

Feedback

Badge

A short status or category marker.

use iced_cube::badge;
use iced_cube::feedback::badge::Variant;
API reference
Variants: Every badge variant, from default to warning.Variants: Every badge variant, from default to warning.
Static preview
Variants. Every badge variant, from default to warning.

Usage

Badges are for short labels that sit next to other content: a status in a table row, a tag on a card, a version number. Keep the text to a word or two.

Success, Warning and Destructive map to the theme’s status colours, so use them only when the badge actually reports a state. For neutral tags, Secondary and Outline stay out of the way.

Badges are not interactive. If a label needs to respond to clicks, use a button instead.

Examples

With icon

A small Lucide icon before the label.

With icon: A small Lucide icon before the label.With icon: A small Lucide icon before the label.
Static preview

In a list

Status badges aligned against list rows.

In a list: Status badges aligned against list rows.In a list: Status badges aligned against list rows.
Static preview

API

ItemDescription
badge(label)Creates a pill-shaped badge with a text label.
.variant(Variant)Default, Secondary, Outline, Destructive, Success or Warning. Defaults to Default.
.icon(glyph)Adds a small Lucide icon before the label.
Esc