Skip to content

Latest commit

 

History

History
54 lines (29 loc) · 1.59 KB

badges.md

File metadata and controls

54 lines (29 loc) · 1.59 KB
title components
Badge React component
Badge

Badge

Badge generates a small badge to the top-right of its child(ren).

Basic badges

Examples of badges containing text, using primary and secondary colors. The badge is applied to its children.

{{"demo": "pages/components/badges/SimpleBadge.js"}}

Customized badges

Here is an example of customizing the component. You can learn more about this in the overrides documentation page.

{{"demo": "pages/components/badges/CustomizedBadges.js"}}

Badge visibility

The visibility of badges can be controlled using the invisible property.

{{"demo": "pages/components/badges/BadgeVisibility.js"}}

The badge auto hides with badgeContent is zero. You can override this with the showZero property.

{{"demo": "pages/components/badges/ShowZeroBadge.js"}}

Maximum value

You can use the max property to cap the value of the badge content.

{{"demo": "pages/components/badges/BadgeMax.js"}}

Dot badge

The dot property changes a badge into a small dot. This can be used as a notification that something has changed without giving a count.

{{"demo": "pages/components/badges/DotBadge.js"}}

Badge overlap

You can use the overlap property to place the badge relative to the corner of the wrapped element.

{{"demo": "pages/components/badges/BadgeOverlap.js"}}

Badge alignment

You can use the horizontalAlignment and verticalAlignment properties to move the badge to any corner of the wrapped element.

{{"demo": "pages/components/badges/BadgeAlignment.js", "hideHeader": true}}