Phoenix Framework


Powerful components

Render Slot is a powerful tool to render many similar cells inside a component

Extremely useful for lists, table rows, table cells, repeatable items that needs to be inside another, like with ul>li, tr>td, etc.

<.unordered_list let={item} items={~w(Apples Oranges Bananas)}>
def unordered_list(assigns) do
  <%= for item <- @items do %>
    <li><%= render_slot(@inner_block, item)%></li>
  <% end %>

More on