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

Default

Badge
<Badge>Badge</Badge>

Themes

PrimarySecondaryTertiaryQuaternaryClear

<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

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

With Icons

ApprovedPendingInfoTagged

<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

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

Sizes

XSSmallMediumLargeXL

<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


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

Custom JSX Content

3 new

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

Props

Data table
TypeDescription
childrenReactNodeOptional custom badge content.
classNamestringAdditional custom class names.
data-testidstringOptional test ID for testing frameworks.
disabledbooleanIf true, disables user interaction and styles as disabled.
iconIconTypeOptional icon to render inside the badge.
onClick((e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void)Click handler for the badge.
outlinebooleanWhether to use the outline style.
roundingRoundingTypeRounding of the badge ('none' | 'small' | 'medium' | 'large' | 'full').
shadowShadowTypeShadow of the badge ('none' | 'light' | 'medium' | 'strong' | 'intense').
sizeSizeTypeBadge size ('xs' | 'small' | 'medium' | 'large' | 'xl').
stateStateTypeThe badge state ('success' | 'error' | 'warning' | 'disabled' | '').
themeThemeTypeTheme color for the badge ('primary' | 'secondary' | 'tertiary' | 'quaternary' | 'clear').
titlestringOptional tooltip shown on hover.