8bit

Search docs

Search for a docs page

Badge

Displays a badge or a component that looks like a badge.

DefaultSecondaryDestructiveOutline

Installation

pnpm dlx shadcn@latest add https://8bit.cnlibs.com/r/badge.json

Usage

import { Badge } from "@/components/ui/badge";
<div className="flex flex-wrap items-center gap-2">
  <Badge>Default</Badge>
  <Badge variant="secondary">Secondary</Badge>
  <Badge variant="destructive">Destructive</Badge>
  <Badge variant="outline">Outline</Badge>
</div>

With Icon

Badges can include an inline icon before the label.

Verified