HEEx Templates in Phoenix Live View
Phoenix LiveView will release a new template HEEX
in the next version 0.16.0
. With that we can create reusable view components like:
defmodule MyComponent do
use Phoenix.Component
def btn(assigns) do
~H"""
<button class="btn"><%= @text %></button>
"""
end
end
Then using like:
<MyComponent.btn text="Save">
So cool!
Tweet