Renders a table.
This component is a pre-styled wrapper around Flop.Phoenix.table/1. A subset of attributes are available and others have been renamed to follow our terminology.
<.table id="users" rows={@users}> <:col :let={user} label="id"><%= user.id %></:col> <:col :let={user} label="username"><%= user.username %></:col> </.table>
#
To make a row sortable, include the field attribute on the col slot:
<.table id="users" rows={@users}> <:col :let={user} field={:name}> <%= user.name %> </:col> </.table>
You must also include a handle_params callback in your LiveView.
| Column headers with links are sortable Name | Column headers with links are sortable Amount | Column headers with links are sortable Expiry date | Column headers with links are sortable Time |
|---|---|---|---|
| Leela | $3,670 | 01/31/2026 | 9:00 AM |
| Fry | $50,560 | 04/05/2026 | 10:30 AM |
| Bender | $0 | 12/03/2026 | 12:45 PM |
| Mom | $3,400 | 12/04/2026 | 4:05 PM |