Open mplatts opened 1 year ago
@mplatts, I got this to work:
use Phoenix.Component
attr :rest, :global,
doc: "the arbitrary HTML attributes for the svg container",
include: ~w(fill stroke stroke-width)
attr :name, :atom, required: true
attr :outline, :boolean, default: true
attr :solid, :boolean, default: false
attr :mini, :boolean, default: false
def icon(assigns) do
apply(Heroicons, assigns.name, [assigns])
end
<.icon name={:academic_cap} class="h-4 w-4" />
Is there an easy way to pass in the icon name as an argument?
eg: