You want to use a separate .heex.html file:
to define a component
use it instead of ~H in a component?
I have not come across an out of box api in phoenix_live_view to achieve the first.
If you are looking for second one - there is no straight forward way to do this.
Hello,
I’d like to use Phoenix function component but without the HEEX code being part of the module’s code - the HTML template is pretty long to be included in the Elixir module itself and would make the navigation and editing expierence somewhat hard.
Is there any way I could render the HTML from an external .html.heex file from within the function body, please?
Something like this
defmodule DashboardWeb.Components.Navigation do
use Phoenix.Component
def main_navigation(assigns) do
…