Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mintlify/components/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Badge component displays compact labels with support for multiple colors, sizes, shapes, and icons. Perfect for tags, status indicators, counts, and labels.Basic Usage
Props
The content to display inside the badge. Typically short text or labels.
color
'gray' | 'blue' | 'green' | 'orange' | 'yellow' | 'red' | 'purple' | 'white' | 'surface' | 'white-destructive' | 'surface-destructive'
default:"gray"
The color scheme of the badge:
gray: Neutral gray (default)blue: Blue informationalgreen: Success or positiveorange: Warning or attentionyellow: Caution or highlightred: Error or dangerpurple: Special or featurewhite: White background (for use on colored surfaces)surface: Adapts to surface (white in light mode, gray in dark mode)white-destructive: White background with red textsurface-destructive: Surface-adapted with red text
The size of the badge:
xs: Extra small (12px text, minimal padding)sm: Small (12px text, small padding)md: Medium (14px text, standard padding)lg: Large (14px text, large padding)
The shape of the badge:
rounded: Rounded corners (default)pill: Fully rounded pill shape
The visual style variant:
solid: Filled background (default)outline: Outlined with transparent background
Whether the badge is disabled. Applies reduced opacity and disabled cursor.
Icon to display before the badge content. Can be:
- A string icon name from FontAwesome or Lucide (use with
iconTypeandiconLibrary) - A React component or element
Icon to display after the badge content. Can be:
- A string icon name from FontAwesome or Lucide (use with
iconTypeandiconLibrary) - A React component or element
iconType
'brands' | 'duotone' | 'light' | 'regular' | 'sharp-duotone-solid' | 'sharp-light' | 'sharp-regular' | 'sharp-solid' | 'sharp-thin' | 'solid' | 'thin'
The FontAwesome icon style type when using string icons.
The icon library to use for string icons.
Click handler function. Makes the badge interactive and renders as a
<button> element.URL for the badge. Makes the badge a link and renders as an
<a> element.Additional CSS classes to apply to the badge.
Deprecated: Use
leadIcon or tailIcon instead. Legacy prop for backward compatibility.Deprecated: Use
variant="outline" instead. Legacy prop for backward compatibility.Examples
Colors
Sizes
Shapes
Variants
With Icons
Icon Libraries
Inline SVG Icons
Interactive Badges
Disabled State
Surface Variants
These variants are designed for use on colored backgrounds:Combined Styles
Custom Styling
Features
Automatic Element Type
The Badge component automatically renders as the appropriate HTML element:<span>: Default for static badges<button>: WhenonClickis provided (unlessdisabled)<a>: Whenhrefis provided (unlessdisabled)
Icon Handling
Icons are automatically styled to match the badge:- String icons are fetched from the specified library
- Inline SVG icons use
fill="currentColor"for color matching - Icons scale appropriately with badge size
Hover Effects
Interactive badges (withonClick or href) automatically show:
- Cursor change to pointer
- Opacity transition on hover
- Smooth transitions
Dark Mode
All badge colors have carefully crafted dark mode variants with:- Appropriate background colors
- Adjusted text colors for readability
- Maintained contrast ratios
Accessibility
- Proper semantic HTML based on usage (button/link/span)
- Disabled state prevents interaction
- Color contrast meets WCAG guidelines
- Icon-only badges should include accessible text