Skip to content

Badge

A short status or label in a soft tinted pill.

0.8 kB gzipSource Registry JSON

Badge playground

Live

Props

tone

Installation

npx shadcn@latest add https://sproutboat.com/ikada/r/badge.json

The CLI writes components/ikada/badge.tsx and merges the ikada theme into your CSS. It also installs the components it is built from: Status Glyph. Or take it from the package: import { Badge } from "@sproutboat/ikada";

Usage

import { Badge } from "@/components/ikada/badge";

<Badge tone="success" dot>
  Live
</Badge>

Examples

Tones

The text carries the meaning; the tone and the shape reinforce it.
neutralsuccesswarningdangerinfo

With a status shape

Each tone has its own glyph, so colour is never the only signal.
neutralsuccesswarningdangerinfo

Live and sprout

Live is the bullseye for a sprout serving traffic; sprout animates the dot in once, for something just created.
LiveReady

Props

BadgeProps
PropTypeDescription
toneStatusStatus that sets the colour and the glyph. Default neutral.
dotbooleanAdds a leading status shape. The text is always the primary signal. Default `false`.
livebooleanWith tone="success" and a dot: the bullseye shape for "Live" (serving traffic) instead of the "Ready" circle. Default `false`.
sproutbooleanWith tone="success" and a dot: the dot sprouts on mount, for something just created or just succeeded. Default `false`.

Also takes every prop of ComponentProps<"span">.

Source: src/components/badge.tsx