lotusui
A Go design system for desktop and mobile — one codebase, native apps. Web when you want it.
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

open demo ↗

Secondary

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

open demo ↗

Destructive

Danger tint + danger ink.

open demo ↗

Outline

Border + ink, no fill.

open demo ↗

Ghost

Ink only — no fill, no border.

open demo ↗

With icon

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

open demo ↗

Spinner

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

open demo ↗

Color

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

open demo ↗

Status

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

open demo ↗

Sizes

open demo ↗

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.

lotusui is a Go design system for native desktop and mobile — and the web when you want it. Docs demos are the real components (WebAssembly) — one gallery app, each Preview an iframe addressed by URL hash.