Basic
Basic
<Badge>Basic</Badge>
Type
Set type
to either "neutral"
, "info"
, "success"
, "warning"
, or "danger"
. Defaults to "neutral"
.
neutral
info
success
warning
danger
<Flex class="flex-wrap gap-3">
<Badge type="neutral">neutral</Badge>
<Badge type="info">info</Badge>
<Badge type="success">success</Badge>
<Badge type="warning">warning</Badge>
<Badge type="danger">danger</Badge>
</Flex>
Size
Set size
to either "sm"
, "md"
, or "lg"
. Defaults to "md"
.
neutral
info
success
warning
danger
neutral
info
success
warning
danger
neutral
info
success
warning
danger
<Stack class="gap-5">
<Flex class="flex-wrap gap-3">
<Badge type="neutral" size="sm">neutral</Badge>
<Badge type="info" size="sm">info</Badge>
<Badge type="success" size="sm">success</Badge>
<Badge type="warning" size="sm">warning</Badge>
<Badge type="danger" size="sm">danger</Badge>
</Flex>
<Flex class="flex-wrap gap-3">
<Badge type="neutral" size="md">neutral</Badge>
<Badge type="info" size="md">info</Badge>
<Badge type="success" size="md">success</Badge>
<Badge type="warning" size="md">warning</Badge>
<Badge type="danger" size="md">danger</Badge>
</Flex>
<Flex class="flex-wrap gap-3">
<Badge type="neutral" size="lg">neutral</Badge>
<Badge type="info" size="lg">info</Badge>
<Badge type="success" size="lg">success</Badge>
<Badge type="warning" size="lg">warning</Badge>
<Badge type="danger" size="lg">danger</Badge>
</Flex>
</Stack>
Rounded
Set rounded
to either "square"
, "sm"
, "lg"
, or "full"
. Defaults to the value of the CSS variable --default-roundedness
. See "Default roundedness".
neutral
info
success
warning
danger
neutral
info
success
warning
danger
neutral
info
success
warning
danger
neutral
info
success
warning
danger
<Stack class="gap-5">
<Flex class="flex-wrap gap-3">
<Badge type="neutral" rounded="square">neutral</Badge>
<Badge type="info" rounded="square">info</Badge>
<Badge type="success" rounded="square">success</Badge>
<Badge type="warning" rounded="square">warning</Badge>
<Badge type="danger" rounded="square">danger</Badge>
</Flex>
<Flex class="flex-wrap gap-3">
<Badge type="neutral" rounded="sm">neutral</Badge>
<Badge type="info" rounded="sm">info</Badge>
<Badge type="success" rounded="sm">success</Badge>
<Badge type="warning" rounded="sm">warning</Badge>
<Badge type="danger" rounded="sm">danger</Badge>
</Flex>
<Flex class="flex-wrap gap-3">
<Badge type="neutral" rounded="lg">neutral</Badge>
<Badge type="info" rounded="lg">info</Badge>
<Badge type="success" rounded="lg">success</Badge>
<Badge type="warning" rounded="lg">warning</Badge>
<Badge type="danger" rounded="lg">danger</Badge>
</Flex>
<Flex class="flex-wrap gap-3">
<Badge type="neutral" rounded="full">neutral</Badge>
<Badge type="info" rounded="full">info</Badge>
<Badge type="success" rounded="full">success</Badge>
<Badge type="warning" rounded="full">warning</Badge>
<Badge type="danger" rounded="full">danger</Badge>
</Flex>
</Stack>
Props
type
Required
false
Type
"neutral" | "info" | "success" | "warning" | "danger"
Default
"neutral"
size
Required
false
Type
"sm" | "md" | "lg"
Default
"md"
rounded
Required
false
Type
"square" | "sm" | "lg" | "full"
Default
none
Notes
Defaults to the value of the CSS variable
--default-roundedness
. See "Default roundedness".children
*Required
true
Type
ComponentChild
Default
none
...rest
Required
false
Type
Omit<ComponentProps<"div">, "size">
Default
none
Notes
See the docs for rest parameters. For
Badge
, you could pass anything you normally would pass to <div>
because the container looks something like this:<div class={className} {...restWithoutClass}>
{children}
</div>