logo

SINGULARITY

DOCS

PurchaseReturn to the Dashboard
Reference

Badge

The Badge component creates a small indicator positioned at the top-right of its child elements.

Basic badge

Demonstrations of badges with text, utilizing primary and secondary color schemes. The badge is attached to its child elements.
4

Color

Apply the color prop to use the theme’s color palette on the component.
44

Customization

This example illustrates how to customize the component. Learn more about customization options in the overrides documentation page.

Badge visibility

The display of badges can be managed using the invisible prop.
1
The badge is hidden by default when badgeContent is zero. This behavior can be overridden using the showZero prop.
0

Maximum value

The max prop can be used to limit the displayed value of the badge content.
9999+999+

Dot badge

The dot prop transforms the badge into a small dot, useful for indicating a change without displaying a count.

Badge overlap

The overlap prop allows you to position the badge relative to the corner of its wrapped element.

Badge alignment

Use the anchorOrigin prop to adjust the badge’s position to any corner of the wrapped element.

Accessibility

The badge content may not be announced correctly by assistive technologies. Provide a complete description, such as with the aria-label attribute: