Heroicons for Phoenix LiveView
Heroicons components for Phoenix LiveView.
Why this one?
- Most other available packages load the SVG files from disk. This package generates heex components which are precompiled and therefore very fast.
- The generated components can be customized with custom classes and additional attributes (see Usage).
-
The package can be easily updated by running
mix heroicons.generate HEROICONS_VERSION. No external deps likenpmare required to keep it current.
Docs can be found at https://hexdocs.pm/heroicons.
Installation
def deps do
[
{:phx_heroicons, "~> 0.1.0"}
]
endUsage
# Use default class of "flex-shrink-0 h-5 w-5"
<Heroicons.Solid.home />
# Use outline version
<Heroicons.Outline.home />
# Override with a custom class
<Heroicons.Solid.home class="h-8 w-8"/>
# Any custom attributes will be passed to the <svg> tag
<Heroicons.Solid.home class="h-8 w-8" x-show="open"/>