Badge

The Badge component displays compact status labels, tags, counts, and metadata. It supports semantic states, themes, icons, outline styling, and can render as a static badge or interactive button.

Usage & Examples

Default

Badge
default.tsx
<Badge>Badge</Badge>

Themes

PrimarySecondaryTertiaryQuaternaryClear
themes.tsx

<Badge theme="primary">Primary</Badge>
<Badge theme="secondary">Secondary</Badge>
<Badge theme="tertiary">Tertiary</Badge>
<Badge theme="quaternary">Quaternary</Badge>
<Badge theme="clear">Clear</Badge>

States

SuccessWarningError
states.tsx

<Badge state="success">Success</Badge>
<Badge state="warning">Warning</Badge>
<Badge state="error">Error</Badge>

With Icons

ApprovedPendingInfoTagged
with-icons.tsx

<Badge icon={FaCheck} state="success">Approved</Badge>
<Badge icon={FaExclamation} state="warning">Pending</Badge>
<Badge icon={FaInfoCircle} theme="primary">Info</Badge>
<Badge icon={FaTag} theme="secondary">Tagged</Badge>

Outline

PrimarySuccessWarning
outline.tsx

<Badge outline theme="primary">Primary</Badge>
<Badge outline state="success">Success</Badge>
<Badge outline state="warning">Warning</Badge>

Sizes

XSSmallMediumLargeXL
sizes.tsx

<Badge size="xs">XS</Badge>
<Badge size="small">Small</Badge>
<Badge size="medium">Medium</Badge>
<Badge size="large">Large</Badge>
<Badge size="xl">XL</Badge>

Interactive Button Badge

interactive-button-badge.tsx

<Badge
  theme="primary"
  icon={FaCheck}
  onClick={() => alert("Badge clicked")}
>
  Clickable
</Badge>

Custom JSX Content

3 new
custom-jsx-content.tsx

<Badge theme="quaternary" ariaLabel="3 new notifications">
  <strong>3</strong>&nbsp;new
</Badge>

Props API

18 props
Columns
Badge props API
Default
Description
childrenReactNodeNopropsOptional custom badge content.
classNamestringNostylingAdditional custom class names.
data-testidstringNotestingBackward-compatible alias for test ID attributes.
disabledbooleanNopropsfalseIf true, disables user interaction and styles as disabled.
glassbooleanNopropsconfigured default glass setting (fallback: false)Applies a translucent frosted-glass treatment using the active theme palette.
hrefstringNopropsOptional href. When provided, the badge renders as an anchor link.
iconIconTypeNopropsOptional icon to render inside the badge.
onClick((e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void)NoeventsClick handler for the badge.
outlinebooleanNostylingconfigured default outline setting (fallback: false)Whether to use the outline style.
relstringNopropsOptional rel attribute when the badge renders as a link.
roundingRoundingTypeNostylingconfigured default rounding (fallback: "medium")Rounding of the badge ('none' | 'small' | 'medium' | 'large' | 'full').
shadowShadowTypeNostylingconfigured default shadow (fallback: "light")Shadow of the badge ('none' | 'light' | 'medium' | 'strong' | 'intense').