Props
| Name | Type | Default | Description |
|---|---|---|---|
append:icon | string | undefined | - | Icon rendered after the label. On a |
clearable | boolean | undefined | false | Renders a trailing clear button and emits Opt-in, which is the one thing that changed on the way from |
clearableLabel | string | undefined | - | Accessible label for the clear button.
Rarely needed: unset, the name is **composed** from the localized
|
icon | string | undefined | - | Renders an icon-only badge. When set, |
loading | boolean | undefined | false | Shows a spinner in place of the leftmost icon, mirroring Also makes a slotted |
prepend:icon | string | undefined | - | Icon rendered before the label. See example |
pt | PtMap<BbBadgePtPart, "loading"> | undefined | - | Passthrough, object form: |
pt:clear | PtValue | undefined | - | |
pt:clear:loading | PtValue | undefined | - | |
pt:icon | PtValue | undefined | - | |
pt:icon:loading | PtValue | undefined | - | |
pt:root | PtValue | undefined | - | |
pt:root:loading | PtValue | undefined | - | |
pt:spinner | PtValue | undefined | - | |
pt:spinner:loading | PtValue | undefined | - | |
pt:text | PtValue | undefined | - | |
pt:text:loading | PtValue | undefined | - | |
size | keyof Sizes | undefined | "md" | Preset size of the badge. Pick it from the control standing next to the badge, not from a remembered constant: |
variant | BadgeVariantType | undefined | "primary" | Visual variant: |
Events
| Name | Type | Description |
|---|---|---|
click:clear | (event: "click:clear", event: MouseEvent): void | 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 | Type | Description |
|---|---|---|
default | object | The badge's label content. When A |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
contentremovedfails silently