Badge
A status badge that morphs its width when the content changes, presses with a spring when interactive, and has an optional shimmer effect.
Customize
Installation
Add the base component with the registry command:
npx shadcn@latest add @kinetic/badgeInstall an effect separately when you need it. Each command also installs the base badge.
npx shadcn@latest add @kinetic/shimmer-badgeUsage
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.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | "default" | Selects semantic background, border, and hover colors. |
animateOnMount | boolean | false | Optionally plays a subtle WAAPI scale pop-in when the badge mounts. |
pulse | boolean | false | Prepends a live indicator dot with a continuous pulse halo (static under reduced motion). |
interactive | boolean | false | Enables pointer cursor, hover lift, and spring press scale; automatically inferred when asChild or onClick is set. |
pressScale | number | 0.95 | Spring scale factor applied while an interactive badge is pressed (clamped 0.88-0.99). |
blurPx | number | 2 | Blur radius in pixels applied during directional content swaps when children update (clamped 0-16). |
speed | number | 1 | Shared speed multiplier for press springs, content swaps, pulse, and mount pop-in (clamped 0.25-4). |
asChild | boolean | false | Merges 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.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | Omit<BadgeProps, "overlay"> | - | Badge props. |