Contact Us

Icon Usage

DOC-00074 guide implementor, developer

Overview

Icons are inline SVGs loaded at build time via the Icon component (src/core/components/primitives/Icon.astro// CORE-OWNED). No icon fonts or external sprites.

Who this is for

  • Implementors adding or replacing icons in pages and components
  • Developers creating site-level icon overrides via the shadowing system

Basic Usage

import Icon from "@core/components/primitives/Icon.astro";

<Icon name="chevron-down" />
<Icon name="linkedin" size="1.5em" label="Visit LinkedIn" />

Props

PropTypeRequiredDefaultDescription
namestringyesIcon filename without .svg extension
sizestringno"1.25em"Width and height. Use CSS units: "1em", "1.5em", "2rem"
labelstringnoAccessible label. If provided: role="img" aria-label="{label}". If absent: aria-hidden="true" (decorative)
classstringnoCSS classes for color, transforms, etc.

Supports rest props for passthrough attributes.

Resolution Order (Shadowing)

The Icon component resolves SVG files in this order:

  1. src/site/assets/icons/utility/{name}.svg (// SITE-OWNED)
  2. src/site/assets/icons/social/{name}.svg (// SITE-OWNED)
  3. src/core/assets/icons/utility/{name}.svg (// CORE-OWNED)
  4. src/core/assets/icons/social/{name}.svg (// CORE-OWNED)

Site icons shadow core icons with the same name, enabling per-site icon customization without modifying core files.

Icon Categories

  • Utility icons: UI elements — chevron-down, chevron-up, close, clipboard, copy, search, menu, etc.
  • Social icons: Branded social links — linkedin, facebook, youtube, instagram, bluesky, x-twitter

Adding a New Icon

  1. Copy the SVG file to the appropriate directory (utility or social, core or site).
  2. Use the filename (without .svg) as the name prop.
  3. Icons are loaded via import.meta.glob() at build time — no registration step needed.

Accessibility

  • Decorative icons (next to visible text): omit label — renders as aria-hidden="true".
  • Meaningful icons (standalone, no adjacent text): provide label — renders as role="img" aria-label="{label}".

Styling

Icons are inlined as SVG elements. Use currentColor inheritance — set text color on parent or via class prop. CSS transforms and filters also work.

REQ-00051 implemented The SiteLogo component shall render an SVG logo (preferred), PNG logo (fallback), or site title text (final fallback) based on what is configured in src/config/site.ts, with no props required for default behavior.

Search

Search across pages and articles. Use arrow keys to navigate results.

Search across pages and articles.

Loading search...

Search is unavailable. Please try again later.

    No results for ""

    Try different keywords or fewer words.