Table
Render responsive tabular data from row and column slots.
Preview
| Name | Role | Status |
|---|---|---|
| Ada Lovelace | Admin | Ready |
| Grace Hopper | Editor | Invited |
Example
<.table rows={@users} caption="Users"><:col :let={user} label="Name"><%= user.name %></:col></.table>
API contract
table/1 uses declared Phoenix attributes and slots. This table is generated from the compiled component metadata.
| Attribute | Type | Required | Default | Accepted values |
|---|---|---|---|---|
id |
:string |
No | nil |
Any value matching the declared type |
rows |
:list |
Yes | — |
Any value matching the declared type |
row_id |
:any |
No | nil |
Any value matching the declared type |
size |
:atom |
No | :md |
[:xs, :sm, :md, :lg, :xl] |
zebra |
:boolean |
No | false |
Any value matching the declared type |
caption |
:string |
No | nil |
Any value matching the declared type |
class |
:any |
No | nil |
Any value matching the declared type |
rest |
:global |
No | — |
Any value matching the declared type |
| Slot | Required | Slot attributes |
|---|---|---|
col |
Yes | label: :string required, class: :any |
action |
No | label: :string |
States and behavior
The responsive wrapper preserves tabular semantics and accepts a screen-reader caption.
Keyboard and accessibility
The table adds no custom key handling. Interactive cells must contain ordinary links, buttons, or form controls.