Skip to content
Glint UI

Badge

A small pill for a status, a tag or a count, in the tones the theme publishes.

Usage

import { Badge, BadgeVariant } from "@glint/components/badge.slint";
import { Tokens } from "@glint/theme/tokens.slint";
export component AppWindow inherits Window {
width: 560px;
height: 200px;
background: Tokens.color-background;
VerticalLayout {
alignment: center;
padding: 24px;
HorizontalLayout {
alignment: center;
spacing: 8px;
Badge {
text: "v2.4.0";
variant: BadgeVariant.secondary;
}
}
}
}

Badge presents a compact rounded chip for metadata, tags, and status indications.

Examples

Variants

Badges support six semantic styles: default, secondary, outline, destructive, ghost, and link.

Sizes

Use size: BadgeSize.sm for dense tables or compact UI rows, and size: BadgeSize.default for standard content badges.

Icons and slotted content

Badges accept leading-icon, trailing-icon, or child components such as Spinner.

API Reference

Properties

PropertyTypeDefaultDescription
variantin BadgeVariantBadgeVariant.defaultVisual style — default, secondary, outline, destructive, ghost, link.
sizein BadgeSizeBadgeSize.defaultHeight + padding — sm, default, lg.
textin stringno defaultLabel rendered inside the badge.
leading-iconin LucideIconno defaultGlyph before the label, normally selected from IconSet in lucide-slint.
trailing-iconin LucideIconno defaultGlyph after the label, normally selected from IconSet in lucide-slint.

Enums

EnumValues
BadgeVariantdefault, secondary, outline, destructive, ghost, link
BadgeSizesm, default

Accessibility

  • Text role. The badge announces as accessible-role: text with its text as accessible label.
  • Icon deduplication. Embedded icons are silenced from the screen reader tree so labels are not read redundantly.