Components

Badge

The shadcn/ui Badge with soft, success, warning and info variants, three sizes and a status dot — plus three animated React badge blocks built with Motion: a pulsing live status badge, a notification count that rolls like an odometer and a shimmering “New” badge.

  • Drop-in shadcn API
  • Server Component friendly
  • Motion blocks
  • prefers-reduced-motion
1096 stars

Installation

$ npx shadcn@latest add https://duskui.com/r/badge.json

Replaces components/ui/badge.tsx; every shadcn variant and badgeVariants still work. CSS only — no "use client" needed.

Usage

status.tsx
import { Badge } from "@/components/ui/badge"

export function Status() {
  return (
    <Badge variant="success" dot>
      Operational
    </Badge>
  )
}

Examples

Variants

The four shadcn variants plus soft, success, warning and info — tinted fills with a hairline border that read well on dark backgrounds.

DefaultSecondaryOutlineDestructiveSoftSuccessWarningInfo

Dot, icons, sizes & links

dot adds a leading status dot in the text color, icons are sized automatically, size picks sm, default or lg, and asChild turns a badge into a link with a hover state.

OperationalDegradedOfflineVerified2m agoChangelog

Blocks

Ready-made variations composed from the base component with Motion. Each installs on its own and pulls in its dependencies automatically.

Pulse Badge

A status badge whose dot emits an expanding ring — for “Live”, “Online” or “Deploying”. The standalone PulseDot is exported too, e.g. for avatar presence. The ring stops under reduced motion; the solid dot stays.

OnlineLiveDeployingOfflineAKAda Kim, online
$ npx shadcn@latest add https://duskui.com/r/pulse-badge.json
PropTypeDefaultDescription
tone"primary" | "success" | "warning" | "danger" | "info" | "muted""success"Dot color.
pulsebooleantrueEmit the ring. Turn off for idle states.
speednumber2Seconds per pulse; lower feels more urgent.
variant / sizeBadge props"outline"Any Badge variant and size.

Animated Count Badge

A count whose digits roll like an odometer when the value changes. Each digit is its own spring, new digits slide in as the number grows, the badge bumps on increases and max caps it at e.g. “99+”. Screen readers get plain text via label.

1096 stars
$ npx shadcn@latest add https://duskui.com/r/animated-count-badge.json
PropTypeDefaultDescription
valuenumber—The count. Negative numbers show as 0. Required.
maxnumber99Above this, show max+.
bumpbooleantrueBump the badge slightly when the count goes up.
label(value: number) => string—Screen-reader text, e.g. “3 unread messages”.

Shimmer Badge

A band of light sweeps across the badge every few seconds — eye-catching for New, Beta or Pro labels without blinking. Static under reduced motion.

NewProBeta
$ npx shadcn@latest add https://duskui.com/r/shimmer-badge.json
PropTypeDefaultDescription
durationnumber1.4Seconds for one sweep.
delaynumber4Pause between sweeps in seconds.
variant / sizeBadge props"soft"Any Badge variant and size.

API Reference

Accepts every <span> prop. Also exports badgeVariants to style other elements as badges.

PropTypeDefaultDescription
variant"default" | "secondary" | "destructive" | "outline" | "soft" | "success" | "warning" | "info""default"Visual style.
size"sm" | "default" | "lg""default"Height, padding and text size.
dotbooleanfalseLeading dot in the current text color.
asChildbooleanfalseRender the child element instead (Radix Slot), e.g. a Link.

Accessibility

  • Color is never the only signal: dots and pulses are aria-hidden decoration next to a text label.
  • Animated Count Badge hides the rolling digits from assistive tech and exposes the value through label. Put the full context (“3 unread”) on the control it decorates.
  • Badges rendered as links via asChild get a visible focus-visible ring.
  • Pulses, shimmers and the count bump stop under prefers-reduced-motion; the count updates instantly.