Components/Data display/Badge
COMPONENT44.44

Badge

Small status label for counts and states. Variants map to classes; success and warning extend the core set.


INSTALL

1pnpm dlx @sayagodev/mo add badge

Or import the files from the package (no copy):

1import "@sayagodev/mo/css/badge.css";

EXAMPLES

Variants
Default Secondary Destructive Outline Ghost
Custom colors
Blue Green Sky Purple Red
Status extensions
Active Pending Failed
With icon
Verified Bookmark
Link
Spinner
Deleting Generating
RTL
شارة ثانوي مدمر مخطط متحقق إشارة مرجعية
Demo
Badge Secondary Destructive Outline

USAGE

1<span class="badge">Primary</span>2<span class="badge outline">Outline</span>3<span class="badge ghost">Ghost</span>4<a class="badge link" href="#">Link</a>5<span class="badge" data-variant="secondary|destructive|success|warning"></span>

API

NAMEKINDDESCRIPTION
[data-variant]attributesecondary · destructive (translucent bg-destructive/10, like shadcn base) · success · warning extensions
.outline .ghost .linkclassSurface variants like Button; hover text uses muted-foreground (shadcn base)
.rounded-fullclassOpt-in pill (default radius is rounded-2xl = 16px, like shadcn base)
--mo-badge-*tokenpadding-x/y and radius hooks

FILES

src/css/badge.css
Install:mo add badge

THEMING · PLAYGROUND

This is the exact component from the examples above, wearing a completely different theme. Edit the tokens and --mo-* hooks in the editor — autocomplete knows them all — and the preview obeys in real time. Your CSS always wins.

Tokens & hooks — edit live
Global tokens
--border--destructive--foreground--muted--muted-foreground--primary--primary-foreground--radius--secondary--secondary-foreground
Component hooks
--mo-badge-padding-x--mo-badge-padding-y--mo-badge-radius

Preview

Default Secondary Destructive Outline Ghost

Your CSS

Try it: type --mo- for the component hooks, or edit any value — the preview obeys in real time.