jbmui

Badge

  • UI Bits

Round check or cross badge in accent, ink, or paper tones for fixed and broken states.

Install

npx shadcn@latest add @jbm/badge

Needs the @jbm entry in components.json; see Install once.

Also installs @jbm/tokens, @jbm/paper.

Usage

Fixed and broken
import { Badge } from "@/jbm/ui/badge"<div style={{ display: "flex", gap: 40 }}>  <Badge kind="check" size={100} />  <Badge kind="x" size={100} tone="ink" /></div>

Props

Stage px
Declared at the documented defaults
Landscape
44 by 44
Vertical
44 by 44
Basis

Square size × size box at the default size 44; the shadow extends below it.

Circle with the paper shadow and a stroked check or cross (55% of the size). Accent and ink fills draw a cream mark; paper draws an ink mark with a 2px ink outline. Static; animate it by wrapping or via style.

PropTypeDefaultDescription
kind"check" | "x"requiredMark to draw: check (fixed) or x (broken).
sizenumber44Diameter in stage pixels.
tonePaperTone"accent"Fill: accent (vermilion, default), ink, or paper (cream with an ink outline).
styleReact.CSSPropertiesnoneInline styles merged last; use for absolute placement, opacity, or transforms.

QA checks

  • Compare all three tones with both marks: the mark stays legible (cream on accent and ink, ink on paper).
  • At small sizes the 4-unit stroke of the 24-unit icon scales down; check the check and cross remain readable around 24px.