All examples in documentation should work. If not then we would submit a bug report, but before that would happen just to be sure could you please share a minimal script to reproduce issue (ideally with example from documentation)?
You can use a minimal example of LiveView from here:
defmodule MyTable do
use Phoenix.LiveComponent
def render(assigns) do
~H"""
<table>
<tr>
<%= for col <- @col do %>
<th><%= col.label %></th>
<% end %>
</tr>
<%= for row <- @rows do %>
<tr>
<%= for col <- @col do %>
<td><%= render_slot(col, row) %></td>
<% end %>
</tr>
<% end %>
</table>
"""
end
end
defmodule SamplePhoenix.SampleLive do
use Phoenix.LiveView
# …
def mount(_params, _session, socket) do
users = [
%{address: "john.doe@example.com", name: "John Doe"},
%{address: "sample@example.com", name: "Sample"}
]
{:ok, assign(socket, :users, users)}
end
# …
def render(assigns) do
~H"""
<.live_component id="my-table" module={MyTable} rows={@users}>
<:col :let={user} label="Name">
<%= user.name %>
</:col>
<:col :let={user} label="Address">
<%= user.address %>
</:col>
</.live_component>
"""
end
end