View Source DaisyUIComponents.Table (DaisyUIComponents v0.1.1)

Table component

https://daisyui.com/components/table/

Summary

Functions

Renders a table with generic styling.

Attributes

  • Global attributes are accepted.

Slots

  • inner_block

Attributes

  • Global attributes are accepted.

Slots

  • inner_block

Attributes

  • Global attributes are accepted.

Slots

  • inner_block

Attributes

  • Global attributes are accepted.

Slots

  • inner_block

Attributes

  • active (:boolean) - Defaults to false.
  • hover (:boolean) - Defaults to false.
  • Global attributes are accepted.

Slots

  • inner_block

Functions

Renders a table with generic styling.

Examples

<.table id="users" rows={@users}>
  <:col :let={user} label="id"><%= user.id %></:col>
  <:col :let={user} label="username"><%= user.username %></:col>
</.table>

or declaring the table components

<.table id="users">

<.thead>
  <.tr>
    <.th>id</.th>
    <.th>username</.th>
  </.tr>
</.thead>
<.tbody>
  <.tr :for={user <- @users}>
    <.td><%= user.id %></.td>
    <.td><%= user.username %></.td>
  </.tr>
</.tbody>

</.table>

Attributes

  • id (:string) - Defaults to nil.
  • rows (:list)
  • row_id (:any) - the function for generating the row id. Defaults to nil.
  • row_click (:any) - the function for handling phx-click on each row. Defaults to nil.
  • row_item (:any) - the function for mapping each row before calling the :col and :action slots. Defaults to &Function.identity/1.
  • zebra (:boolean) - Defaults to false.
  • size (:string) - Must be one of "xs", "sm", "md", or "lg".
  • Global attributes are accepted.

Slots

  • col - Accepts attributes:
    • label (:string)
  • action - the slot for showing user actions in the last table column.
  • inner_block

Attributes

  • Global attributes are accepted.

Slots

  • inner_block

Attributes

  • Global attributes are accepted.

Slots

  • inner_block

Attributes

  • Global attributes are accepted.

Slots

  • inner_block

Attributes

  • Global attributes are accepted.

Slots

  • inner_block

Attributes

  • active (:boolean) - Defaults to false.
  • hover (:boolean) - Defaults to false.
  • Global attributes are accepted.

Slots

  • inner_block