Skip to content

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.

The above badge is added to the heading like:

## Example :badge[Badge]

The badge may have a variant attached like {variant=note}. The following variants are available:

  • Note
  • Tip
  • Danger
  • Caution
  • Success
### Blue Note :badge[Note]{variant=note}
### Purple Tip :badge[Tip]{variant=tip}
### Red Danger :badge[Danger]{variant=danger}
### Orange Caution :badge[Caution]{variant=caution}
### Green Success :badge[Success]{variant=success}

When you choose Heading Badges as an option, starlightHeadingBadges is added to the Starlight Plugins configuration.