Badge

A short status label in five tones, soft or solid, with an optional icon. A number inside rolls to its new value. Cards.

Open playground
DraftReviewReadyPendingFailedNew12

About

Badge is a React component in the Cards category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Badge } from "@ashutoshswamy/smoui" and set tone, variant, icon among its 6 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Badge } from "@ashutoshswamy/smoui";

<Badge tone="positive">Ready</Badge>

Props 6

tone

Default neutral.

"neutral""accent""positive""warning""negative"
variant

Default soft.

"soft""solid"
icon / size

Leading icon and height.

IconName / "sm""md"
children

Short label.

ReactNode
tone

Fill and text treatment.

"neutral""accent""positive"default "neutral"
className

Class on the badge.

string