Skip to main content

Badge

A status badge that morphs its width when the content changes, presses with a spring when interactive, and has an optional shimmer effect.

Stable+20.1%DeprecatedDraft
Badge·count=9

Customize

Press scale0.95
Reveal blur (px)2
Speed1

Installation

Add the base component with the registry command:

npx shadcn@latest add @kinetic/badge

Install an effect separately when you need it. Each command also installs the base badge.

npx shadcn@latest add @kinetic/shimmer-badge

Usage

Render a badge with one of the style variants:

import { Badge } from "@/components/kinetic/ui/badge";

export function Status() {
  return <Badge variant="secondary">Beta</Badge>;
}

Shimmer

Use ShimmerBadge for a light sweep. A static badge loops the sweep, an interactive badge plays it once on hover.

import { ShimmerBadge } from "@/components/kinetic/ui/shimmer-badge";

<ShimmerBadge variant="outline">New</ShimmerBadge>

Every effect accepts the same props as Badge.

Variants

Use variant with default, secondary, destructive, outline, ghost or link.

<Badge variant="outline">Draft</Badge>
<Badge variant="destructive">Failed</Badge>

Pulse

Set pulse to prepend a live dot with a pulsing halo.

<Badge pulse>Live</Badge>

Interactive

A badge with onClick or asChild becomes interactive: it gets a pointer sheen and compresses on press (pressScale). Set interactive to force it on or off.

<Badge asChild>
  <a href="/changelog">v2.4</a>
</Badge>

Changing content

When the children change, the badge animates its width and slides the new text in with a short blur (blurPx). Set animateOnMount for a pop-in on first render.

<Badge variant="outline">Updates: {count}</Badge>

Motion preferences

Use speed to scale every animation. Reduced motion keeps the badge static, including the pulse and the shimmer.

API Reference

Badge / badgeVariants

Status pill with automatic width morphing on content changes, a pointer sheen and spring press when interactive, an optional pulse dot, and built-in asChild slot merging.

PropTypeDefaultDescription
variant"default" | "secondary" | "destructive" | "outline" | "ghost" | "link""default"Selects semantic background, border, and hover colors.
animateOnMountbooleanfalseOptionally plays a subtle WAAPI scale pop-in when the badge mounts.
pulsebooleanfalsePrepends a live indicator dot with a continuous pulse halo (static under reduced motion).
interactivebooleanfalseEnables pointer cursor, hover lift, and spring press scale; automatically inferred when asChild or onClick is set.
pressScalenumber0.95Spring scale factor applied while an interactive badge is pressed (clamped 0.88-0.99).
blurPxnumber2Blur radius in pixels applied during directional content swaps when children update (clamped 0-16).
speednumber1Shared speed multiplier for press springs, content swaps, pulse, and mount pop-in (clamped 0.25-4).
asChildbooleanfalseMerges badge styling, refs, and props onto a single child element without external slot libraries.

ShimmerBadge

Badge with a light sweep that loops on a static badge and plays on hover when interactive. Accepts the Badge props.

PropTypeDefaultDescription
...propsOmit<BadgeProps, "overlay">-Badge props.

Notes

Use Badge variants instead of custom colored span pills, and use asChild when wrapping interactive links.