Skip to content

DocsDisplayBadge

PT

Display

Badge

Status in four tones and a percent change that turns green or red.

CSS only

Example

Delivered In transit Delivery failed In review Neutral New +14.8% -3.2%

Installation

Badge ships in the full package, in unslop.css:

curl -fsSL unslop.leallabs.dev/i | sh

No build It's just CSS: with unslop.css on the page, the classes already work.

Classes and variants

ClassWhat it does
u-badgeNeutral base, 24px tall.
u-badge--ok, --warn, --err, --infoState tones, with a soft background and measured text.
u-badge--pillFully rounded corners.
u-badge--deltaPositive change. With data-dir="down", it becomes a drop in red.

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
textcontentColor is never the only cue: write the status or the sign.

Type to search. Arrows pick, Enter opens.