Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Code Block
- Collapsible
- Combobox
- Command
- Context Menu
- Copy Button
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Form
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Page Header
- Pagination
- Panel
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Section Header
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Stat
- Stat Card
- Switch
- Table
- Tabs
- Textarea
- Theme Toggle
- Toggle
- Toggle Group
- Tooltip
- Typography
Badge
Displays a badge or a component that looks like one.
Badge
01
Installation
Add the badge component with the shadcn CLI.
bash
npx shadcn@latest add https://swiss.ui.unsanity.ai/r/badge.json02
Usage
tsx
import { Badge } from "@/components/ui/badge"03
Examples
Variants
DefaultSecondaryOutlineDestructiveSignal
import { Badge } from "@/components/ui/badge"
<div className="flex flex-wrap gap-2">
<Badge>Default</Badge>
<Badge variant="secondary">Secondary</Badge>
<Badge variant="outline">Outline</Badge>
<Badge variant="destructive">Destructive</Badge>
<Badge variant="signal">Signal</Badge>
</div>Signal
New
import { Badge } from "@/components/ui/badge"
<Badge variant="signal">New</Badge>