Skip to content

KBadge ​

A number or status mark on buttons and icons.

Install ​

bash
pnpm add @ikun-ui/badge
bash
yarn add @ikun-ui/badge
bash
npm install @ikun-ui/badge

Basic usage ​

Displays the amount of new messages.

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

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.

Customizations ​

Displays text content other than numbers.

When value is a String, it can display customized text.

Dot Mark ​

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

Use the attribute isDot. It is a Boolean.

Badge Props ​

NameTypeDefaultDescription
valuestring / number''display value.
maxnumber99maximum value, shows {max}+ when exceeded. Only works if value is a number.
isDotbooleanfalseif a little dot is displayed.
showbooleantrueshow badge.
typeprimary / success / error / warning / infoerrorbadge type.
clsstring''Additional class for component
attrsRecord<string, string>{}Additional attributes

Badge Slots ​

NameDescription
defaultCustomize default content

MIT Licensed