Icon
An inline comment renders a Starlight icon as an SVG. On GitHub the comment is invisible. In Starlight it’s an inline icon.
Basic usage
Section titled “Basic usage”See the launch guide for details.
View Markdown source
See the <!-- icon:rocket --> launch guide for details.With emoji fallback
Section titled “With emoji fallback”For icons that should be visible on GitHub too, prefix with an emoji. The comment replaces the emoji in Starlight.
🚀 Launch your project
⭐ Featured content
View Markdown source
:rocket:<!-- icon:rocket --> Launch your project
:star:<!-- icon:star --> Featured contentHow it renders
Section titled “How it renders”| Context | Rendering |
|---|---|
| GitHub | Invisible (or emoji if prefixed) |
| Starlight | Inline SVG icon matching the surrounding text size |
Parameters
Section titled “Parameters”The icon name is part of the comment keyword itself:
<!-- icon:name -->Any icon from Starlight’s icon set is available.
HTML output
Section titled “HTML output”<svg aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="currentColor"> <path d="..."/></svg>