Skip to content
On this page

Badge UPDATED

Badges are used to inform the user of the status of specific data.

Basic usage

Badge use error theme color by default. You only need to set the value attribute to display the corresponding badge.

99+
9
happy

Custom color

We have o variant to handle contextual colors.

Badge can also be used as a dot. You can set dot attribute to display a dot. And it has the highest priority.

Values

Badge can display a number or a string. If the value is greater than 99, it will be displayed as 99+. Or you can set max attribute to change the maximum value.

99
99+
199
999+

If the value is 0, it will not be displayed. You can set showZero attribute to display 0.

0

Badge Props

NameTypeDefaultDescription
valuestring | numberundefinedDisplay badge content.
maxnumber99Greater than ${max}, display ${max}+.
dotbooleanfalseOnly a dot style.
showZerobooleanfalseWhether to display the number 0.

Badge Slots

NameParametersDescription
default()Badge's content.

MIT Licensed