stnd.build

@stnd/icon

Circle 2 — Application Superpower (Official Extension) · Stable · First-Party

Role: SVG icon component (<Icon>) with build-time copying (130+ icons) and Lottie vector animation support.

When to use: Render inline or cached SVG icons sized to cap-height (1cap) or optical tokens.

Quick Start (TL;DR)

---
import Icon from "@stnd/icon/Icon.astro";
---
<Icon icon="ph:magnifying-glass" width="1cap" height="1cap" />

Unified icon system for the Standard Ecosystem.

ELI5

One <Icon icon="…" /> component with two execution modes depending on the target environment:

Component / Mode Resolution Timing Source Client JS
Icon.astro (default inline mode) Build time (SSR) Local packages/icon/icons/ library, falling back to api.iconify.design Zero
Icon.svelte (and Icon.astro file mode) Runtime Static /icons/<prefix>/<name>.svg copied from the local library at build time Minimal
Build Log Warning: "N missing from local library"

Static /icons/... files are populated only from packages/icon/icons/. Icons not present locally still render normally in Icon.astro (inline mode fetches them at build time), but will 404 if requested at runtime via Icon.svelte.

Use it:

---
import Icon from "@stnd/icon/Icon.astro";
---
<Icon icon="ph:house" />
<Icon icon="home" /> <!-- alias, see tokens.js -->

Overview

@stnd/icon provides a consistent API for using icons across different frameworks (Astro and Svelte) and libraries (Phosphor, MingCute). It supports static SVG inlining, local file serving, and animated Lottie icons.

Key Components

Features

Cheatsheet

Usage

In Astro

---
import Icon from "@stnd/icon/Icon.astro";
---
<Icon icon="ph:house" />
<Icon icon="search" /> <!-- alias -->

In Svelte

<script>
  import Icon from "@stnd/icon/Icon.svelte";
</script>
<Icon icon="ph:rocket" width="2em" />

Tokens

Commonly used icons have short aliases defined in tokens.js. You can extend this mapping in your module configuration.