Shadcn UI Components

Badge

Badges are used to highlight an item's status for quick recognition. They can be used for labels, tags, counts, and status indicators.


Badge Examples

Variants

DefaultSecondaryDestructiveOutline

Common Use Cases

NewBetaBreakingComing Soon

Status Indicators

ActivePendingInactiveDraft

Installation

# The component is already installed at:
# src/components/ui/shadcn/badge.tsx

Usage

import { Badge } from '@/components/ui/shadcn/badge'

export function BadgeDemo() {
  return (
    <div className="flex gap-2">
      <Badge>Default</Badge>
      <Badge variant="secondary">Secondary</Badge>
      <Badge variant="destructive">Destructive</Badge>
      <Badge variant="outline">Outline</Badge>
    </div>
  )
}

Props

PropTypeDefaultDescription
variantdefault | secondary | destructive | outlinedefaultThe visual style of the badge
Previous
Avatar