GameServerWeb.Components.DynamicIcon (game_server_web v1.0.935)

Copy Markdown

A tiny runtime SVG loader for hero-style icons stored under priv/static/heroicons/.

Usage:

<.dynamic_icon name={"hero-book-open"} class="w-5 h-5" />

Behavior:

  • Loads the raw SVG at runtime from priv/static/heroicons/<name>.svg
  • Caches successful reads in an ETS cache for performance
  • Falls back to the compiled <.icon> component when the SVG file is missing or when the requested name is considered unsafe

Summary

Functions

dynamic_icon(assigns)

Attributes

  • name (:string) (required)
  • class (:string) - Defaults to "".