Badge

A number or status mark on buttons and icons.

Basic Usage

Displays the amount of new messages.

The amount is defined with value which accepts Number or String.

12
3
1
2
1

Max Value

You can customize the max value.

The max value is defined by property max which is a Number. Note that it only works when value is also a Number.

99+
10+

Customizations

Displays text content other than numbers. Or you can use the content slot to customize content.

When value is a String, it can display customized text. Or use the content slot.

new
hot
99

Red Dot

Use a red dot to mark content that needs to be noticed.

Use the attribute is-dot. It is a Boolean.

query

Offset 2.7.0

Set offset of the badge dot, the format is [left, top], which represents the offset of the status dot from the left and top of the default position.

1

API

Attributes

NameDescriptionTypeDefault
valuedisplay value.string / number''
maxmaximum value, shows {max}+ when exceeded. Only works if value is a number.number99
is-dotif a little dot is displayed.booleanfalse
hiddenhidden badge.booleanfalse
typebadge type.enumdanger
show-zero 2.6.0Whether to show badge when value is zero.booleantrue
color 2.6.3background color of the dotstring
offset 2.7.0offset of badge[ number , number ]
badge-style 2.7.1custom style of badgeobject
badge-class 2.7.1custom class of badgestring

Slots

NameDescriptionType
defaultcustomize default content-
content 2.9.1customize barge contentobject

Source

ComponentStyleDocs

Contributors