Heading Badges
Starlight Heading Badges is a Starlight Plugin that enables adding badges to your Markdown and MDX headings that also appear in the Table of Contents.
Starlight offers a built-in Badge component, but they will not appear in the Table of Contents.
Example Badge
Section titled “Example ”BadgeThe above badge is added to the heading like:
## Example :badge[Badge]Badge Variants
Section titled “Badge Variants”The badge may have a variant attached like {variant=note}.
The following variants are available:
- Note
- Tip
- Danger
- Caution
- Success
Blue Note Note
Section titled “Blue Note ”Note### Blue Note :badge[Note]{variant=note}Purple Tip Tip
Section titled “Purple Tip ”Tip### Purple Tip :badge[Tip]{variant=tip}Red Danger Danger
Section titled “Red Danger ”Danger### Red Danger :badge[Danger]{variant=danger}Orange Caution Caution
Section titled “Orange Caution ”Caution### Orange Caution :badge[Caution]{variant=caution}Green Success Success
Section titled “Green Success ”Success### Green Success :badge[Success]{variant=success}Enabling Heading Badges
Section titled “Enabling Heading Badges”When you choose Heading Badges as an option,
starlightHeadingBadges
is added to the
Starlight Plugins configuration.