SigmaKit.Components.Table (sigma_kit v0.0.1)

Summary

Functions

Attributes

  • id (:any) - Defaults to nil.
  • page_number (:integer) - Defaults to 1.
  • total_pages (:integer) (required)
  • page_size (:integer) (required)
  • total_entries (:integer) (required)

Renders a table with generic styling.

Functions

pagination(assigns)

Attributes

  • id (:any) - Defaults to nil.
  • page_number (:integer) - Defaults to 1.
  • total_pages (:integer) (required)
  • page_size (:integer) (required)
  • total_entries (:integer) (required)

table(assigns)

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>

Attributes

  • id (:string) (required)
  • rows (:list) (required)
  • 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.
  • alternate (:boolean) - Defaults to false.
  • paginate (:boolean) - Defaults to false.
  • page_number (:integer)
  • total_pages (:integer)
  • page_size (:integer)
  • total_entries (:integer)
  • row_item (:any) - the function for mapping each row before calling the :col and :action slots. Defaults to &Function.identity/1.

Slots

  • col (required) - Accepts attributes:
    • label (:string)
  • action - Accepts attributes:
    • label (:string)
    • icon (:string)
    • event (:string)