UIIcons

Badge

A small label for status, category, or count indicators.

Badge
Badge

Installation

pnpm dlx stera-ui@latest add badge

Examples

Variant

Use the variant prop to change the style of the badge.

Badge
Badge Variants
VariantDescription
defaultSubtle neutral background
outlineBordered, no background
solidStrong neutral inverse background

Colors

Appy semantic and brand colors to a badge

DefaultBrandAccentDangerSuccessWarning
Badge Colors
VariantDescription
defaultSubtle neutral background
brandPrimary brand color
accentAccent brand color
dangerRed
successGreen
warningYellow

With Icon

You can render an icon inside the badge. Use data-icon="inline-start" to render the icon on the left and data-icon="inline-end" to render the icon on the right.

OfflineCopied
With Icon

With Spinner

You can render a spinner inside the badge. Remember to add the data-icon="inline-start" or data-icon="inline-end" prop to the spinner.

ProcessingThinking
With Spinner

Sizes

Use size prop to select between sm (default), md, and lg.

SmallDefaultLarge
Badge Sizes
SizeDescription
sm16px height (default)
md20px height
lg24px height

API Reference

PropTypeDefault
variant"default" "outline" "solid" "brand" "brand-outline" "brand-solid" "accent" "accent-outline" "accent-solid" "danger" "danger-outline" "danger-solid" "success" "success-outline" "success-solid" "warning" "warning-outline" "warning-solid""default"
size"sm" | "md" | "lg""md"
renderReact.ReactElement

Accepts all standard <span> props. Supports render prop for polymorphic rendering via Base UI's useRender.