The typed icon set: every heroicon the site ships, as an atom.
Generated at compile time from deps/heroicons (24px solid set), so the
atoms are the icon catalog — :trophy, :currency_dollar,
:academic_cap, … all 324 of them. Anything choosing an icon in code
does it through a typed value; an unknown atom raises instead of silently
rendering nothing.
svg/1 returns the icon's inline SVG (compile-time embedded), which is how
<.entity_icon> renders fallbacks — deliberately not the hero-* CSS
classes, because Tailwind only generates those for names it finds literally
in source, and these names are chosen at runtime.
Entities with no uploaded icon_url fall back to default/1 for their
type: every group without an icon shares one icon, every tournament
another, and so on. API clients get icon_url as null and apply their
own equivalent.
Summary
Functions
The shared default icon atom for an entity type without an icon.
The icon a path/1 URL refers to, or :error for anything else — an
uploaded image, a CDN URL, a name we do not ship.
The hero-* class name for a typed icon atom. Raises on unknown atoms.
Every typed icon atom, for pickers and docs.
The URL an icon is served at, for storing in an entity's icon_url.
The icon's raw inline SVG (24px solid, currentColor fill).
Types
@type entity() :: :quest | :leaderboard | :tournament | :group | :notification
@type icon() :: atom()
Functions
The shared default icon atom for an entity type without an icon.
The icon a path/1 URL refers to, or :error for anything else — an
uploaded image, a CDN URL, a name we do not ship.
The hero-* class name for a typed icon atom. Raises on unknown atoms.
@spec list() :: [icon()]
Every typed icon atom, for pickers and docs.
The URL an icon is served at, for storing in an entity's icon_url.
iex> GamendWeb.Icons.path(:trophy)
"/icons/trophy.svg"Storing a URL rather than an atom keeps icon_url one kind of thing: a game
client fetches it like any other icon, while the web UI recognises its own
route and inlines the SVG instead (see GamendWeb.CoreComponents.entity_icon/1),
so currentColor still follows the theme.
The icon's raw inline SVG (24px solid, currentColor fill).