This component no longer exists. It was in ondo-ui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-09 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
number-badge
ondo-ui/number-badgeRemovedComponent
A self-anchoring count badge for avatars and icons with animated counts and 99+ overflow.
Install it
npx shadcn@latest add https://ui.ondo.dou.so/r/number-badge.jsonSource
1"use client"23import { cva, type VariantProps } from "class-variance-authority"45import { Badge } from "@/components/ui/badge"6import { NumberCount } from "@/components/ui/number-count"7import { cn } from "@/lib/utils"89const numberBadgeVariants = cva(10 "absolute z-10 min-w-5 justify-center rounded-full px-1 tabular-nums ring-1 ring-background backdrop-blur-sm transition-all duration-200 ease-out select-none",11 {12 variants: {13 placement: {14 "top-right": "top-0 right-0 translate-x-1/2 -translate-y-1/2",15 "top-left": "top-0 left-0 -translate-x-1/2 -translate-y-1/2",16 "bottom-right": "bottom-0 right-0 translate-x-1/2 translate-y-1/2",17 "bottom-left": "bottom-0 left-0 -translate-x-1/2 translate-y-1/2",18 },19 hidden: {20 true: "scale-0 opacity-0 pointer-events-none",21 false: "",22 },23 },24 defaultVariants: {25 placement: "top-right",26 hidden: false,27 },28 }29)3031interface NumberBadgeProps32 extends Omit<React.ComponentProps<typeof Badge>, "children"> {33 value: number34 max?: number35 showZero?: boolean36 placement?: NonNullable<VariantProps<typeof numberBadgeVariants>["placement"]>37 children?: React.ReactNode38}3940function NumberBadge({41 value,42 max = 99,43 showZero = false,44 placement = "top-right",45 variant,46 className,47 children,48 ...props49}: NumberBadgeProps) {50 const capped = value > max51 const hidden = value <= 0 && !showZero5253 return (54 <span className="relative inline-flex w-fit shrink-0">55 {children}56 <Badge57 variant={variant}58 aria-hidden={hidden || undefined}59 className={cn(numberBadgeVariants({ placement, hidden }), className)}60 {...props}61 >62 <NumberCount63 value={capped ? max : value}64 suffix={capped ? "+" : undefined}65 />66 </Badge>67 </span>68 )69}7071export { NumberBadge, numberBadgeVariants, type NumberBadgeProps }
What it pulls in
npm packages
Other registry items
