Skip to content

Badge API

API reference docs for the Stash Badge component. Learn about the props, CSS, and other APIs of this exported module.

Import

ts
import Badge from '@leaflink/stash/Badge.vue';

Props

NameTypeDefaultDescription
animatebooleanfalseIf true, the badge will animate when the content changes
color"red" | "blue"redColor of the badge Options: 'red' or 'blue'
contentnumber | stringundefinedThe badge's content
isDisabledbooleanfalseShows a gray badge with content
maxnumber | string99The max value of the `content` prop. If the value is greater than this, the badge will show the max value and a `+` sign.
offset{ top?: number; right?: number; }() => ({ top: undefined, right: undefined, })Offset to adjust the badge's position. It does not apply to inline position badges.
position"top-right" | "inline"top-rightBadge position. Options: - inline: shows the badge directly next to the content (on the right), with a left margin of 6px - top-right: will overlap the badge over whatever is passed in the default slot
showZerobooleanfalseThe badge will be hidden if the content is `0` unless this prop is set to true.
variant"dot" | "standard"standardBadge variant

Slots

NameDescription
default

Events

None