SigmaKit.Components.Table (sigma_kit v0.0.1)
Summary
Functions
Attributes
id
(:any
) - Defaults tonil
.page_number
(:integer
) - Defaults to1
.total_pages
(:integer
) (required)page_size
(:integer
) (required)total_entries
(:integer
) (required)
Renders a table with generic styling.
Functions
Attributes
id
(:any
) - Defaults tonil
.page_number
(:integer
) - Defaults to1
.total_pages
(:integer
) (required)page_size
(:integer
) (required)total_entries
(:integer
) (required)
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 tonil
.row_click
(:any
) - the function for handling phx-click on each row. Defaults tonil
.alternate
(:boolean
) - Defaults tofalse
.paginate
(:boolean
) - Defaults tofalse
.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
)