PhoenixDuskmoon.Component.Table (PhoenixDuskmoon v7.2.1)
View SourceDuskmoon UI Table Component
Summary
Functions
Generates a table.
Functions
Generates a table.
Examples
<.dm_table data={[
%{
name: "Shmi Skywalker",
portrayal: "Pernilla August (Episodes I-II)"
},
%{
name: "Luke Skywalker",
portrayal: "Mark Hamill (Episodes IV-IX, The Mandalorian, The Book of Boba Fett)"}
]}
>
<:caption>Skywalker House</:catption>
<:col :let={r} label="Name" label_class="text-teal-600" class="text-teal-400">
<%= r.name %>
</:col>
<:col :let={r} label="Portrayal">
<%= r.portrayal %>
</:col>
</.dm_table>Attributes
id(:any) - html attribute id. Defaults tofalse.class(:any) - html attribute class. Defaults to"".border(:boolean) - show table border. Defaults tofalse.zebra(:boolean) - show zebra striping. Defaults tofalse.pin_rows(:boolean) - pin rows for sticky positioning. Defaults tofalse.pin_cols(:boolean) - pin columns for sticky positioning. Defaults tofalse.size(:string) - table size (xs, sm, md, lg). Defaults tonil.compact(:boolean) - make table more compact. Defaults tofalse.data(:list) - table data list. Defaults to[].stream(:boolean) - stream data. Defaults tofalse.
Slots
caption- render a caption of table.Example
Accepts attributes:<:caption> Table information </:caption>id(:any) - table caption id.class(:any) - table caption class.
col- render a column of table.Example
Accepts attributes:<:col :let={r} label="Name"> <%= r.name %> </:col>label(:string) - table column title.label_class(:any) - table column title title.class(:any) - table row column class.
expand- render a one column row after each row of table.Example
Accepts attributes:<:expand :let={r} label="Name"> <pre> <%= r.description %> </pre> </:expand>id(:any) - table row expand id.class(:any) - table row expand class.