stnd.buildSTANDARD MANUAL2026-07-15

@stnd/icon

Short Tokens Cheatsheet

Commonly used icons have short aliases. Edit packages/icon/tokens.js to add your own.

Essentials

searchph:magnifying-glass
closeph:x
menuph:list
backph:arrow-left
forwardph:arrow-right
homeph:house
settingsph:sliders

Actions

saveph:floppy-disk
editph:pencil-simple
trashph:trash
shareph:share-network
copyph:copy
plusph:plus
minusph:minus
checkph:check
commandph:terminal-window
loginph:sign-in
logoutph:sign-out
plantph:plant
downloadph:download-simple
uploadph:upload-simple
refreshph:arrows-clockwise

Status

warningph:warning
errorph:warning-circle
successph:check-circle
infoph:info
loadingph:spinner

Types

noteph:file-text
imageph:image
folderph:folder
keyph:key
linkph:link
calendarph:calendar
userph:user
lockph:lock
globeph:globe
mailph:envelope
starph:star
heartph:heart
eyeph:eye
codeph:code

Icon Sizes

0.8em
1em
1.2em
1.6em
2em
2.5em
3em

Library Samples

Standard supports local SVG resolution for Phosphor and MingCute.

Phosphor ph:*

Browse all →
plant
house
magnifying-glass
gear
book-open
chat-circle
bell
lightning
moon
sun
palette
rocket
compass
crown
tree
feather

MingCute mingcute:*

Browse all →
home-3-line
search-line
settings-5-line
heart-line
star-line
user-3-line
notification-line
calendar-line
moon-line
sun-line
code-line
globe-line
compass-line
palette-line
rocket-line
close-line

Animated Icons

Lottie-based animations served from /lottie/*.json.

arrow-down-line
arrow-left-line
arrow-right-line
arrow-up-line
heart-line
loading-line
loading-3-line
loading-4-line
menu-line
more-2-line

@stnd/icon

Unified icon system for the Standard Ecosystem.

ELI5

One <Icon icon="…" /> component, two very different things happen behind it depending on which one you use:

  • Icon.astro (“inline” mode): at build time, the SVG gets fetched
    (from a local file, or a live call to api.iconify.design if it’s not local) and inlined straight into the page’s HTML. Zero client-side JS, works even for icons not in the local library — as long as the build machine has internet access when it builds.
  • Icon.svelte (and Icon.astro‘s “file” mode): serves the SVG as a
    static file from /icons/<prefix>/<name>.svg at runtime. That folder is populated only from the local library (packages/icon/icons/) during the build — an icon that isn’t local won’t be there, and the request 404s. That’s what the build log’s "N missing from local library" warning means: those icons work fine in Icon.astro (inline) but will 404 as static files.

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

  • Icon.astro: Build-time SSR icon component. Inlines SVGs for zero client-side JS.
  • Icon.svelte: Runtime icon component. Serves SVGs as static files.
  • Lottie.astroLottie.svelte: Components for rendering animated Lottie icons.

Features

  • Multi-Library: Native support for Phosphor (ph:) and MingCute (mingcute:).
  • Short Tokens: Use aliases like search instead of ph:magnifying-glass.
  • Zero Config: Icons are bundled and resolved automatically.
  • Resolution Order (resolve.server.js): 
    1. Local SVG file (packages/icon/icons/<prefix>/<name>.svg).
    2. Live fetch from api.iconify.design (no installed-package step exists —
      the resolver goes straight from local file to network).

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.

  • search → ph:magnifying-glass
  • settings → ph:sliders
  • home → ph:house
  • plant → ph:plant

Notes / Observations

  • The build log’s icon-copy warning ("N missing from local library") only
    matters for file-mode icons (Icon.svelte, or Icon.astro’s file mode) — inline-mode Icon.astro resolves those same icons fine via the live API at build time. Don’t read the warning as “these icons are broken” across the board; check which mode is actually being used.

Todo

  • [ ] Finish the icon system (WIP) — per the build logs tonight, ~87-270
    icons are consistently missing from the local library across apps. Either backfill packages/icon/icons/ with the ones actually in use, or confirm the live-API fallback is an acceptable production dependency (a Cloudflare Worker relying on api.iconify.design being up, at build time only — not per-request — but still an external dependency worth being deliberate about).