vael-ui v0.3.10

Data Display

Badge

A small dot, count, or label overlaid on the corner of another element.

Install

import { Badge } from 'vael-ui'

Playground

5
import { Badge } from 'vael-ui'

<Badge variant="primary" :count="5" :max="99" :dot="false" animated>Badge</Badge>

Props

NameTypeDefaultDescription
variant"primary" | "danger" | "muted" | "success" | "warning" | "info""primary"
countnumber | undefined
maxnumber | undefined99Counts above this render as `"${max}+"`.
dotboolean | undefinedfalseMinimal size, no content — a plain presence dot.
animatedboolean | undefinedtrue`false` drops the built-in count-change animation — use when driving your own animation instead.
uiPartial<{ root: UiPartValue; }> | undefined

Slots

NameTypeDescription
defaultanyOverrides `count` entirely — anything you render here wins.

Events

No events.

Exposed

NameTypeDescription
elHTMLElement | null