Packages

Generic SVG icon component builder for Phoenix LiveView

Current section

Files

Jump to
ex_icon priv templates icon.ex.eex
Raw

priv/templates/icon.ex.eex

defmodule <%= inspect(@module_name) %> do
@moduledoc """
Provides function components for icons.
This file is generated. Do not edit.
"""
use Phoenix.Component
<%= for {name, {svg, attrs}} <- @icons do %><%= for {attr, default} <- attrs do %>
attr :<%= attr %>, :string, default: "<%= default %>"<% end %>
def <%= name %>(assigns) do
~H"""
<%= ExIcon.indent(svg, 4) %>
"""
end
<% end %>end