lotusui the ikaito design language for Gio — desktop, mobile, web
GitHub

Badge

Small rounded labels: four variants × seven sizes × any color.

A small rounded label for counts, statuses and health. The status doctrine holds whatever the colors: tinted pill + deep ink, never saturated fill + white text.

Installation

Use the module import (the default), or own the source: lotusui add vendors the component into your app and lotusui update keeps the copy mergeable — see Registry.

Go
go get github.com/ikaito-com/lotusui

# or vendor the source into your app:
go run github.com/ikaito-com/lotusui/cmd/lotusui add badge

Usage

Go
lotusui.Badge(th, "Badge", lotusui.BadgeOpts{})

Secondary

Neutral tint + ink — metadata that shouldn't shout.

Go
lotusui.Badge(th, "Secondary", lotusui.BadgeOpts{Variant: lotusui.BadgeSecondary})

Destructive

Danger tint + danger ink.

Go
lotusui.Badge(th, "Destructive", lotusui.BadgeOpts{Variant: lotusui.BadgeDestructive})

Outline

Border + ink, no fill.

Go
lotusui.Badge(th, "Outline", lotusui.BadgeOpts{Variant: lotusui.BadgeOutline})

Ghost

Ink only — no fill, no border.

Go
lotusui.Badge(th, "Ghost", lotusui.BadgeOpts{Variant: lotusui.BadgeGhost})

With icon

Icon renders an embedded icon before the text, in the badge's ink.

Go
lotusui.Badge(th, "Verified", lotusui.BadgeOpts{Icon: lotusui.IconAccept})

Spinner

Start/End render arbitrary widgets around the text — a working state's spinner.

Go
lotusui.Badge(th, "Deleting", lotusui.BadgeOpts{Variant: lotusui.BadgeDestructive,
	Start: lotusui.SpinnerTint(th, 12, th.Palette.Danger)})

Color

Color re-colors the badge from any ColorScale, the pastel way — tinted fill with deep same-hue ink.

Go
lotusui.Badge(th, "Teal", lotusui.BadgeOpts{Color: lotusui.Teal})
lotusui.Badge(th, "Pink", lotusui.BadgeOpts{Color: lotusui.Pink})

Status

The status pairs are tokens, not schemes — set Bg/Fg directly.

Go
p := th.Palette
lotusui.Badge(th, "Healthy", lotusui.BadgeOpts{Bg: p.SuccessBg, Fg: p.Success})
lotusui.Badge(th, "Error", lotusui.BadgeOpts{Bg: p.DangerBg, Fg: p.Danger})

Sizes

Go
lotusui.Badge(th, "New", lotusui.BadgeOpts{Size: lotusui.Size2XS})
lotusui.Badge(th, "New", lotusui.BadgeOpts{Size: lotusui.Size2XL})

API

OptionTypeDescription
VariantBadgeVariantBadgeDefault (default), BadgeSecondary, BadgeDestructive, BadgeOutline, BadgeGhost.
SizeSizeThe shared size presets (Size2XS–Size2XL).
ColorColorScaleRe-colors the badge the pastel way (SoftScheme) from any scale.
Scheme*SchemeWins over Color: full manual slot control.
Bg / Fgcolor.NRGBARaw override for token pairs (statuses); both set wins over everything.
IconstringEmbedded icon before the text, in the badge's ink.
Start / Endlayout.WidgetArbitrary leading/trailing widgets — a Spinner; the widget owns its color.

Every demo on this site is the real Go component compiled to WebAssembly — one gallery app, one bundle, addressed by URL hash.