Badge
Use the <Badge>
component to display small pieces of information, such as status or labels.
Pass the content you want to display to the text
attribute of the <Badge>
component.
By default, the badge will use the theme accent color of your site. To use a built-in badge color, set the variant
attribute to one of the following values: note
(blue), tip
(purple), danger
(red), caution
(orange), or success
(green).
The size
attribute (default: small
) controls the size of the badge text. medium
and large
are also available options for displaying a larger badge.
For further customization, use other <span>
attributes such as class
or style
with custom CSS.
Variants
Note
This is a Badge that is inline positioned.
Tip
This is a Badge that is inline positioned.
Caution
This is a Badge that is inline positioned.
Danger
This is a Badge that is inline positioned.
Success
This is a Badge that is inline positioned.
Size
Small
This is a small Badge that is inline positioned.
Medium
This is a medium Badge that is inline positioned.
Large
This is a large Badge that is inline positioned.
Keystatic config
To add this Starlight component as a Keystatic content component, register it as a content component with the following schema: