Skip to Content
Archi-ui 1.0.25 is released 🎉

Badge

Badge generates a small badge, which can be used to show notification with count or just a dot.

Basic Badge

Example of a badge containing text.

new

Usage

import { Badge } from 'archi-ui'
<Badge badgeContent='new' />

Variants

The Badge comes with a two variants: standard(default) and dot.

You can use standard variant for displaying count or some content like text, icons, an SVG icon.

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

10
99+

Color

Use color prop to apply different colors to component.

50
50
50
50
50
50

Size

Use size prop to change the size of the badge.

10
10
10

Badge Visibility

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

10

Show Badge

showZero Prop

The badge hides automatically when badgeContent is zero. You can override this with the showZero prop.

0

Maximum Value

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

99
99+
999+

Badge Alignment

80
50
60
10

Badge API

API reference docs for the React Badge component.

Props

NameTypeDefaultDescription
badgeContentnode-The content rendered within the badge.
classNamestring-Override or extend the styles applied to the component.
variant'standard' | 'dot''standard'The variant to use.
size'sm' | 'md' | 'lg''sm'The size of the badge.
rounded'none' | 'full' | 'md''full'The border-radius of the component.
color'default' | 'primary' | 'secondary' | 'info' | 'warning' | 'success' | 'error''primary'The color of the component.
invisibleboolfalseIf true, the badge is invisible.
showZeroboolfalseControls wheather the badge is hidden when badgeContent is zero.
maxnumber99Max count to show.
Last updated on