Props
| Name | Description |
|---|---|
append:icon Type: string | Icon rendered after the label. On a |
clearable Type: booleanDefaultfalse | Renders a trailing clear button and emits Opt-in, which is the one thing that changed on the way from |
clearableLabel Type: string | Accessible name of the clear button, whole: set, it is the name on any body ("Remove the filter Deleted"). Rarely needed: unset, the name is composed from the localized Set it when a |
icon Type: string | Renders an icon-only badge. When set, Keep writing the label in the slot: it becomes the accessible name. An icon-only badge with an empty slot is an error for |
loading Type: booleanDefaultfalse | Shows a spinner in place of the leftmost icon ( Also makes a slotted |
prepend:icon Type: string | Icon rendered before the label. See example |
pt Type: PtMap<BbBadgePtPart, "outline" | "primary" | "destructive" | "activeLink" | "exactActiveLink" | "loading" | "secondary"> | Passthrough, object form: |
pt:<part> Type: PtValue | Passthrough, attribute form: one attribute per part, |
size Type: keyof SizesDefault"md" | Preset size of the badge. Pick it from the control standing next to the badge, not from a remembered constant: |
variant Type: BadgeVariantTypeDefault"primary" | Visual variant: |
Events
| Name | Description |
|---|---|
click:clear Type: (event: MouseEvent): void | Emitted when the clear button is pressed (only rendered when Fires when the clear button is pressed. The badge is controlled and removes nothing on its own — drop the item from your own state in the handler. Pressing the × never fires a slotted |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
append:icon Type: BbBadgeIconSlotProps | The trailing icon, replacing |
default Type: object | The badge's label content. When A |
icon Type: BbBadgeIconSlotProps | The glyph of an icon-only badge, replacing the |
prepend:icon Type: BbBadgeIconSlotProps | The leading icon, replacing |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
contentremovedfails silently