Badge
Usage
Use the default slot to set the text of the Badge.
Badge
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }
You can also use the label
prop:
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }
Style
Use the color
and variant
props to change the visual style of the Badge.
variant
can besolid
(default),outline
,soft
orsubtle
.
Badge
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }
Besides all the colors from the ui.colors
object, you can also use the white
and black
colors with their pre-defined variants.
White
Badge
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }
Gray
Badge
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }
Black
Badge
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }
Size
Use the size
prop to change the size of the Badge.
Badge
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }
Rounded
To customize the border radius of the Badge, you can use the ui
prop.
Badge
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }
ui
prop.Icon
Use any icon from Iconify by setting the icon
prop by using this pattern: i-{collection_name}-{icon_name}
.
Use the leading
and trailing
props to set the icon position or the leading-icon
and trailing-icon
props to set a different icon for each position.
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }
Slots
leading
Use the #leading
slot to set the content of the leading icon.
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }
trailing
Use the #trailing
slot to set the content of the trailing icon.
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }
Props
{}
config.default.size
"sm"
"xs"
"md"
"lg"
null
config.default.color
"primary"
"white"
"gray"
"black"
"red"
"orange"
"amber"
"yellow"
"lime"
"green"
"emerald"
"teal"
"cyan"
"sky"
"blue"
"indigo"
"violet"
"purple"
"fuchsia"
"pink"
"rose"
config.default.variant
"solid"
"outline"
"soft"
"subtle"
null
null
null
false
false
Config
{ "message": "You should use slots with <ContentRenderer>", "value": {}, "excerpt": false, "tag": "div" }