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.8em1em1.2em1.6em2em2.5em3emLibrary Samples
Standard supports local SVG resolution for Phosphor and MingCute.
Phosphor ph:*
Browse all →planthousemagnifying-glassgearbook-openchat-circlebelllightningmoonsunpaletterocketcompasscrowntreefeatherMingCute mingcute:*
Browse all →home-3-linesearch-linesettings-5-lineheart-linestar-lineuser-3-linenotification-linecalendar-linemoon-linesun-linecode-lineglobe-linecompass-linepalette-linerocket-lineclose-lineAnimated Icons
Lottie-based animations served from /lottie/*.json.
arrow-down-linearrow-left-linearrow-right-linearrow-up-lineheart-lineloading-lineloading-3-lineloading-4-linemenu-linemore-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 toapi.iconify.designif 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(andIcon.astro‘s “file” mode): serves the SVG as a
static file from/icons/<prefix>/<name>.svgat 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 inIcon.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.astro/Lottie.svelte: Components for rendering animated Lottie icons.
Features
- Multi-Library: Native support for Phosphor (
ph:) and MingCute (mingcute:). - Short Tokens: Use aliases like
searchinstead ofph:magnifying-glass. - Zero Config: Icons are bundled and resolved automatically.
- Resolution Order (
resolve.server.js):- Local SVG file (
packages/icon/icons/<prefix>/<name>.svg). - Live fetch from
api.iconify.design(no installed-package step exists —
the resolver goes straight from local file to network).
- Local SVG file (
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-glasssettings→ph:slidershome→ph:houseplant→ph:plant
Notes / Observations
- The build log’s icon-copy warning (
"N missing from local library") only
matters for file-mode icons (Icon.svelte, orIcon.astro’s file mode) — inline-modeIcon.astroresolves 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 backfillpackages/icon/icons/with the ones actually in use, or confirm the live-API fallback is an acceptable production dependency (a Cloudflare Worker relying onapi.iconify.designbeing up, at build time only — not per-request — but still an external dependency worth being deliberate about).