Skip to content

GitHub Alerts

GitHub alerts let you highlight important information using a familiar blockquote syntax. The starlight-github-alerts plugin converts them into styled Starlight asides automatically.

GitHub defines five alert types. Each one maps to a Starlight aside variant:

GitHub AlertRenders as StarlightAppearance
[!NOTE]noteBlue info box
[!TIP]tipPurple suggestion box
[!IMPORTANT]cautionYellow warning box
[!WARNING]cautionYellow warning box
[!CAUTION]dangerRed danger box

Note that [!IMPORTANT] and [!WARNING] both render as the caution aside, while [!CAUTION] renders as the more severe danger aside.

The syntax mirrors what you’d write in a GitHub issue or PR:

> [!NOTE]
> Your note content here.
> [!TIP]
> Your tip content here.

Alerts support full Markdown inside them:

The plugin accepts options to change which Starlight aside each alert type renders as. The defaults are:

starlightGitHubAlerts({
types: {
note: "note", // blue
tip: "tip", // purple
important: "caution", // yellow
warning: "caution", // yellow
caution: "danger", // red
},
});

Each value can be 'note', 'tip', 'caution', or 'danger'.