Badges are used to inform users of the status of a piece of information or of an action that has been taken.

Badge
lg
md
sm
xl
xs
xxl
M
Ab
A#-Ab
Bass Guitar

Props

Themeable

Accepts StackView props.

Use the badge key in ThemeProvider to customize the default properties of this component.

colorstring | FlattenedPalette

Background color of the badge, sets an accessible text color

onClickFunction

onClick={stopPropagationClick(onClick)}

Callback passed to stopPropagationClick which adds event.stopPropagation() to a component’s onClick event. Used to prevent element’s onClick from bubbling up the tree.

radiusnumber | string

The size of the radius. (Default is 3px).

renderLeftReactReactNode

Allows rendering any content inside the beginning of the badge.

renderRightReactReactNode

Allows rendering any content inside the end of the badge.

size'xs' | 'sm' | 'md' | 'lg' | 'xl'

Size of badge

squareboolean

Uses a 1:1 padding ratio, useful for icon only badges.

titlestring

The text to be rendered