Status chip whose dot squashes against the wall and whose label crossfades as the badge reflows when the status changes.
Change the valueChange the value
Connections that move data in and out of this workspace.
Webhook endpoint
Sends events to your server as they happen.
Billing sync
Keeps invoices in step with the ledger.
Audit stream
Mirrors sign-ins and permission changes.
status-badge, lively
Use it for the state of a record in a table, a list row or a page header: an invoice that is paid, a job that is running, a sync that failed. The badge is a label, not a control: when the app changes the status, the dot is kicked into the badge's left wall and squashes, the label crossfades and the pill reflows to its new width, so the change is noticed without anyone looking for it. For counts use a number badge; for a choice the person makes use a segmented control or a select.
pnpm dlx shadcn@latest add @motionkit/status-badgenpx shadcn@latest add @motionkit/status-badgeyarn dlx shadcn@latest add @motionkit/status-badgebunx --bun shadcn@latest add @motionkit/status-badgeRequires the @motionkit namespace in components.json. See Installation.
import { StatusBadge } from "@/components/ui/status-badge"
export function JobStatus({ running }: { running: boolean }) {
return (
<StatusBadge tone={running ? "live" : "neutral"}>{running ? "Running" : "Queued"}</StatusBadge>
)
}The change plays whenever the tone or the label text changes. When the label is translated or is
not plain text, pass a stable status key instead. temperament sets how hard the dot hits the
wall: a short press at calm, a clear squash at playful. A change into destructive never
bounces: errors only crossfade. The tone never blends: the new colour takes over in one move at
the squash, and a soft ring in the old colour leaves the dot and crosses the pill, so the eye
follows the change from the marker to the label. Meanwhile the old label rolls up and the new one
rolls in from below, a line apart.
A status often needs its reason. detail explains it ("The ledger answered 502") and since
says when it started; both appear in a small card above the badge on hover, keyboard focus or
tap, with the time written relative to now in the reader's language ("2 minutes ago"). The clock
is read only when the card opens, so server rendering never depends on it.
<StatusBadge tone="destructive" since={failedAt} detail="The ledger answered 502.">
Failed
</StatusBadge>Make a badge interactive (for example "filter by this status") with asChild:
<StatusBadge asChild tone="warning">
<button type="button" onClick={() => setFilter("pending")}>
Pending
</button>
</StatusBadge>Prop
Type
Also accepts all props of Omit<ComponentProps<"span">, "children">.
The six tones in sm and md, with an icon marker and the dot-only form for dense cells.
Change the valueChange the value
status-badge, lively
Marking every invoice as paid changes six badges at once. Each badge takes its row's index, so
the changes cascade on the temperament's stagger, capped at 0.6 s; dense keeps the kick and the
label roll calm. The table announces the bulk action once instead of six times.
Change the valueChange the value
| Invoice | Status |
|---|---|
| Invoice #1042 | Due |
| Invoice #1043 | Due |
| Invoice #1044 | Due |
| Invoice #1045 | Due |
| Invoice #1046 | Due |
| Invoice #1047 | Due |
status-badge, lively
span with its text label. The dot, icon and halo are aria-hidden; the tone is
never conveyed by colour alone, because the label always exists (visible, or sr-only with
labelHidden).info uses its own --info colour (shipped with the item), so it stays blue whatever the
theme's primary is.foreground on a 10-12% tint of the tone, which meets AA contrast in both themes
for every tone; the dot gets a darker rim so it keeps 3:1 against the tint.announce adds a polite role="status" region next to the badge that reads "Status: Paid" after
a change. It is off by default: a bulk change should be announced once by the table, not by every
badge.detail or since, a plain badge becomes focusable (tabIndex={0}) and is linked to a
hidden description with aria-describedby, so the reason is read with the status. The visible
card is aria-hidden, which keeps it out of the name of an asChild button. It opens on hover,
focus and tap, stays open while the pointer is over it, closes on Escape and shifts to stay 8 px
inside the viewport.asChild the badge takes the child's semantics (button or link), a visible focus ring that
follows the pill and a 24 px hit area.The badge is not focusable by default. With detail or since, Tab reaches it and opens the
detail card; Escape closes it. With asChild on a button or a link, Tab, Enter and Space do what
the child does.
The dot does not stretch or squash and no ripple crosses the pill: the tone swaps at once, the two labels cross-fade linearly in the short fade time and the width follows in the same fade. Live dots stop breathing and keep a still 2 px ring around the dot, so a live status never reads as a plain success. The detail card fades in place.
At rest nothing runs. A change animates a few transforms and the label box's width for well under
a second; the ripple is one transform and opacity tween, removed when it ends. The live breath is a slow transform and opacity loop on the dot that pauses off screen,
in hidden tabs and with reduced motion (useShouldAnimate).
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 6.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, @radix-ui/react-slot, motion.
a value change, ambient loop (pauses off screen and in hidden tabs)
No stretch, squash or ripple: the tone swaps at once and the labels cross-fade in the short fade time; live dots keep a still 2 px ring so live never reads as success.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)