Examples
Basic
| Prop | Default | Type | Description |
|---|---|---|---|
label | - | string | The label of the badge. |
You can also use default slot to set the badge label. Refer to slots for more information.
Badge 4
Variant
| Prop | Default | Type | Description |
|---|---|---|---|
badge | soft | {variant} | The variant of the badge. |
| Variant | Description |
|---|---|
soft | The default variant. |
solid | The solid variant. |
outline | The outline variant. |
~ | The unstyle or base variant |
Soft BadgeSolid BadgeOutline BadgeBase Badge
Color
| Prop | Default | Type | Description |
|---|---|---|---|
badge | {variant}-primary | {variant}-{color} | The color of the badge. |
Dynamic colors:
soft-primary (default)solid-pinkoutline-infosoft-successoutline-yellowsolid-erroroutline-indigo
Static colors:soft-graysolid-blackoutline-white
Size
| Prop | Default | Type | Description |
|---|---|---|---|
size | xs | string | Allows you to change the size of the input. |
🚀 Adjust input size freely using any size, breakpoints (e.g.,
sm:sm, xs:lg), or states (e.g.,hover:lg, focus:3xl).
BadgeBadgeBadge
Icon
icon={icon} - add an icon to the badge.
By default we use heroicons and tabler for the icons, you can use any icon provided by Iconify through icones, refer to configuration for more information.
v1.2.0OfflineOnline
Closable
| Prop | Default | Type | Description |
|---|---|---|---|
closable | false | boolean | Add a close icon to the badge. |
BadgeBadgeBadgeBadgeBadgeBadge
Slots
| Name | Props | Description |
|---|---|---|
default | - | The badge label. |
Events
| Event Name | Description |
|---|---|
@close | emit an event when the close icon is clicked. Use in conjunction with closable. |
Presets
shortcuts/badge.ts
Props
types/badge.ts