Badge

A small capsule: an accent label, a grey count or the red badge of a Dock icon.

@cupertinoui/badgeRegistry JSON

Installation

pnpm dlx shadcn@latest add @cupertinoui/badge

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

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

<Badge variant="destructive">3</Badge>

API Reference

Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.

Badge

PropTypeDescription
variant"default" | "secondary" | "destructive" | "outline" | "ghost" | "link"
Default: "default"
The style.
renderReactElementRender a link with the badge's styles.
classNamestringExtra classes, merged with the component's own.