Badge
Badge Secondary Destructive Outline
Verified
8
99
20+
---import { Badge } from "@/components/ui/badge"import { Icon } from "@/components/ui/icon"---
<div class="flex flex-col items-center gap-2"> <div class="flex w-full flex-wrap gap-2"> <Badge>Badge</Badge> <Badge variant="secondary">Secondary</Badge> <Badge variant="destructive">Destructive</Badge> <Badge variant="outline">Outline</Badge> </div> <div class="flex w-full flex-wrap gap-2"> <Badge variant="secondary" class="bg-blue-500 text-white dark:bg-blue-600"> <Icon name="badge-check" class="size-3" /> Verified </Badge> <Badge class="h-5 min-w-5 rounded-full px-1 font-mono tabular-nums"> 8 </Badge> <Badge class="h-5 min-w-5 rounded-full px-1 font-mono tabular-nums" variant="destructive" > 99 </Badge> <Badge class="h-5 min-w-5 rounded-full px-1 font-mono tabular-nums" variant="outline" > 20+ </Badge> </div></div>Installation
Section titled “Installation”To install the badge component, run the following command:
npx shadcn@latest add @fulldev/badgeimport { Badge } from "@/components/ui/badge"<Badge variant="default">Badge</Badge>You can use the href attribute to render the badge as a link element.
---import { Badge } from "@/components/ui/badge"---
<Badge href="/">Badge</Badge>