Badge

A badge is used to bring attention to an element.

Usage

Disabled

A disabled badge is usually used inside other components that may be disabled, like a tag or a list box.

Indeterminate

An indeterminate badge is used when the value is unknown or not applicable.

Variants

The different variants of a badge.

High Count

If a value above 99 is needed, use 99+ instead of the number.

Text

A badge can have any text content.

Props

variant?

The visual style of the badge.

Defaults to primary.
isDisabled?

Whether or not the badge is disabled.

isIndeterminate?

Whether or not the badge is indeterminate and should just be a dot. This will ignore any children.

children?

The children of the component. A function may be provided to alter the children based on component state.

className?

The CSS className for the element. A function may be provided to compute the class based on component state.

style?

The inline style for the element. A function may be provided to compute the style based on component state.

Migration Notes

Coming from Orbiter, you should be aware of the following changes:

  • highlight is not supported.
  • pushed is not supported.
  • reverse is not supported, use flex-direction or row-reverse instead.
  • size is not supported.
  • variant has different values.
  • icon variant it not supported.
  • wrapperProps has been removed.
  • Badge is no longer floating. Use the FloatingBadge component to add this feature.
  • FloatingBadge has new props such as placement and offset.
  • overlap is used inside FloatingBadge and the new values are circular and rectangular.