DEV Community

Cover image for Phoenix LiveView, nested .inputs_for
Mykolas Mankevicius
Mykolas Mankevicius

Posted on

Phoenix LiveView, nested .inputs_for

TIL: You can nest .inputs_for in Phoenix LiveView forms to make inputs visually coherent.

Note: This is a simplified example.

<.inputs_for :let={profile} field={@form[:profile]}>
  <Fields.text field={profile[:first_name]} />
  <.inputs_for :let={images} field={@form[:images]}>
    <Fields.avatar field={images[:avatar]} />
  </.inputs_for>
</.inputs_for>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)