Skip to main content
Version: 57.2.0

Badge

Badge is a label that indicates status or importance. Badges should provide quick recognition.\n

Package: @terreno/ui
Categories: Component
Props interface: BadgeProps
Story source: demo/stories/Badge.stories.tsx

Live demo

Props

PropTypeRequiredDescription
colorunionFor the "status" variant, whether the dot uses the bold (saturated) or subtle (light) tone.
customBackgroundColorstringWhen status is "custom", determines the badge's background color.
customBorderColorstringWhen status is "custom", determines the badge's border color.
customIconColorkeyof TextThemeWhen status is "custom", determines the badge's icon color
customIconNameIconNameWhen status is "custom", determines the badge's icon
customTextColorstringWhen status is "custom", determines the badge's text color.
iconNameIconNameThe name of the icon to display in the badge.
maxValuenumberThe maximum value to display. Used for "numberOnly" variant to display "${maxValue}+" when value is greater than max.
secondarybooleanIf true, the badge will have a secondary style.
statusunionThe status of the badge. Determines its color and appearance.
testIDstringRoot test id for the primary interactive element or container.
valueunionThe text or number to display inside the badge.
variantunionThe variant of the badge. "status" renders a small colored dot (no text) used to indicate an active/modified state.