Components

Badge

Pill-shaped labels with glassmorphic styling for status, categories, and file formats

Badge

Versatile badge components for displaying labels, status indicators, and file format tags. Features glassmorphic styling with backdrop blur and gradient-masked borders.

Usage

import { Badge, BadgeWithDot, FormatBadge } from "@/components/ui/badge";

export default function Example() {
  return (
    <div className="flex gap-4">
      <Badge>New</Badge>
      <BadgeWithDot dotStatus="success">Active</BadgeWithDot>
      <FormatBadge>DOC</FormatBadge>
    </div>
  );
}

Components

Badge

The base badge component with glassmorphic styling.

BadgeWithDot

Badge with a colored dot indicator for status display.

FormatBadge

Specialized badge for file format labels (DOC, MP4, PDF, etc.) with centered text and minimum width.

Props

Badge Props

PropTypeDefaultDescription
variant"default" | "outline" | "solid" | "subtle""default"Visual style variant
size"sm" | "default" | "lg""default"Badge size

BadgeWithDot Props

PropTypeDefaultDescription
size"sm" | "default" | "lg""default"Badge size
dotColorstring-Custom dot color (CSS value)
dotStatus"default" | "success" | "warning" | "error" | "info""default"Predefined status color

FormatBadge Props

PropTypeDefaultDescription
size"sm" | "default" | "lg""default"Badge size

Variants

Style Variants

// Default - glassmorphic with blur and gradient border
<Badge variant="default">Default</Badge>

// Outline - transparent with border
<Badge variant="outline">Outline</Badge>

// Solid - 10% opacity background
<Badge variant="solid">Solid</Badge>

// Subtle - 5% opacity background
<Badge variant="subtle">Subtle</Badge>

Size Variants

// Small - 8px radius, xs text
<Badge size="sm">Small</Badge>

// Default - 12px radius, sm text
<Badge size="default">Default</Badge>

// Large - 16px radius, base text
<Badge size="lg">Large</Badge>

Examples

Status Badges

<div className="flex gap-3">
  <BadgeWithDot dotStatus="success">Online</BadgeWithDot>
  <BadgeWithDot dotStatus="warning">Away</BadgeWithDot>
  <BadgeWithDot dotStatus="error">Offline</BadgeWithDot>
  <BadgeWithDot dotStatus="info">Busy</BadgeWithDot>
</div>

Custom Dot Color

<BadgeWithDot dotColor="#8b5cf6">
  Custom Purple
</BadgeWithDot>

File Format Labels

<div className="flex gap-2">
  <FormatBadge>DOC</FormatBadge>
  <FormatBadge>MP4</FormatBadge>
  <FormatBadge>PDF</FormatBadge>
  <FormatBadge>PNG</FormatBadge>
</div>

Category Tags

<div className="flex flex-wrap gap-2">
  <Badge variant="subtle">Design</Badge>
  <Badge variant="subtle">Development</Badge>
  <Badge variant="subtle">Marketing</Badge>
</div>

With Icons

<Badge>
  <CheckIcon className="w-3 h-3 mr-1" />
  Verified
</Badge>

Notification Count

<Badge variant="solid" size="sm">
  99+
</Badge>

Design Tokens

Dimensions

SizePaddingBorder RadiusMin Width (Format)
sm8px 8pxvar(--radius-xs) (8px)40px
default4px 12pxvar(--radius-sm) (12px)52px
lg6px 16pxvar(--radius-lg) (16px)64px

Effects

TokenValueDescription
Backgroundvar(--gradient-overlay-170)Glassmorphic gradient
Blurvar(--blur-sm) (6px)Backdrop blur
Bordervar(--neutral-2-10)Gradient-masked border
Inset shadowinset 0px 0px 8px rgba(248,248,248,0.25)Inner glow

Status Colors

StatusTokenColor
defaultvar(--neutral-2-40)rgba(248, 248, 248, 0.4)
successvar(--color-success)#4ade80
warningvar(--color-warning)#fbbf24
errorvar(--color-error)#f87171
infovar(--color-info)#60a5fa

Found In

  • Bento10 - Category labels
  • Bento18 - File type indicators
  • Bento19 - Price tags
  • Bento20 - Format badges (DOC, MP4)

Accessibility

  • Uses semantic <span> element
  • Color is not the only indicator (text labels included)
  • Sufficient color contrast for all variants
  • Status dots include text labels for screen readers

On this page