# `LedgerUI.Icons`
[🔗](https://github.com/devaction-labs/ledger_ui/blob/v0.2.0/lib/ledger_ui/icons.ex#L1)

The icons an app vendored with `mix ledger_ui.icons`, loaded for `<.icon>`.

    # config/config.exs
    config :ledger_ui, :icons_path, "priv/hugeicons"
    # or, to resolve it inside a release:
    config :ledger_ui, :icons_path, {:my_app, "priv/hugeicons"}

The folder is read once, on first use, and kept in `:persistent_term` as a map of
`name => iodata parts`, so a lookup costs one `Application.get_env/3`, one `:persistent_term`
read and one map access, with no file access. When a name is missing the folder's signature (modification
time and file count) is compared with the loaded one and the folder is read again if it changed, so icons added by
`mix ledger_ui.icons get`/`sync` show up in a running dev server without a restart (a missing name
in a stable folder costs one `File.stat/1`, and `<.icon>` logs it anyway).

Each file is converted again on load (`LedgerUI.Icons.Hugeicons.convert/1`), so only shapes
survive. Without `:icons_path` nothing is loaded and every lookup misses.

# `fetch`

```elixir
@spec fetch(String.t()) :: tuple() | nil
```

The render parts of a vendored icon (see `LedgerUI.Components.Icon`), or `nil`.

# `names`

```elixir
@spec names() :: [String.t()]
```

The names of the vendored icons currently loaded.

# `path`

```elixir
@spec path() :: Path.t() | nil
```

The configured folder as an absolute path, or `nil`.

# `reload`

```elixir
@spec reload() :: :ok
```

Forgets the loaded icons; the next lookup reads the folder again.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
