Badge displays compact inline information, including short labels and counts. Use Tag for categories, Chip for compact controls, or Status for a named state with an indicator.
Usage
span.
With an icon
aria-hidden and keep a visible label to explain the content.
Appearance
size accepts xs, sm, or md. color accepts tertiary, inherit, primary, or secondary. shape accepts pill or circle. The defaults are sm, tertiary, and pill. The circular treatment has a fixed width equal to its height. Use pill for longer content, including abbreviated counts.
Counts and visibility
aria-label or aria-labelledby.
Native composition
className, style, and ref target the actual root element. render accepts an element or callback through Base UI composition. Choose an appropriate native owner for interactive content:
Props
Types and defaults are generated from the publicBadgeProps type. Native attributes and event handlers are also accepted.
ReactNode
Caller-provided text, numbers, icons, or other inline content.
"inherit" | "primary" | "secondary" | "tertiary"
default:"tertiary"
Neutral tertiary, inherited text, primary accent, or secondary treatment.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>
Replaces the default span. Native props, handlers, and the ref target the rendered element.
"circle" | "pill"
default:"pill"
Rounded pill label or fixed circle with width equal to its height. Use pill for longer content.
"md" | "sm" | "xs"
default:"sm"
Compact height, font size, and spacing: xs, sm, or md.