Components
Local Icons
Use the bundled Lucide icons, or add your own SVGs, without a runtime icon dependency.
Compass keeps every icon local. There is no icon font and no icon package to install, so icons render as inline SVG and inherit the surrounding text color.
Use in components
The Icon component in src/components/ui/Icon.astro renders any SVG from src/icons by its file name:
---
import Icon from '@/components/ui/Icon.astro';
---
<Icon name="rocket" class="size-5" />
<Icon name="social-github" class="size-4" />
- outline icons come from
src/icons/lucideand are addressed by file name, such asrocketorbook-open - filled brand marks come from
src/icons/bootstrapand are addressed associal-<file name> - size and color come from the
classyou pass, sosize-5 text-accentworks as expected
Category icons in src/config/docs.ts use the same names, so the homepage cards, the sidebar, and the mobile menu pick them up automatically.
Add a new icon
- Copy the SVG for the icon you want from Lucide.
- Save it in
src/icons/lucidewith the icon’s name as the file name, such asmap.svg. - Reference it with
<Icon name="map" />or seticon: 'map'on a category.
Unknown names fall back to the link icon, so a typo shows up as a visible placeholder instead of breaking the build.
Use in MDX
For a one-off icon inside an article, paste the SVG inline:
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor">
<path d="M12 5v14M5 12h14" />
</svg>
To make Icon available in every article without an import, register it in src/components/docs/mdx-components.ts.