plushie/widget/table
Table widget builder. Data table with typed columns and row maps.
Columns and rows are encoded as props (list of maps), not as child nodes. The Rust renderer expects this structure.
Types
A table column definition.
pub type Column {
Column(
key: String,
label: String,
align: option.Option(String),
width: option.Option(length.Length),
sortable: option.Option(Bool),
)
}
Constructors
-
Column( key: String, label: String, align: option.Option(String), width: option.Option(length.Length), sortable: option.Option(Bool), )
Values
pub fn column(key: String, label: String) -> Column
Create a column with a key and display label.
pub fn column_to_prop_value(c: Column) -> node.PropValue
Encode a column to a PropValue dict.
pub fn rows(
t: Table,
r: List(dict.Dict(String, node.PropValue)),
) -> Table
Set the table rows.
pub fn separator_color(t: Table, c: color.Color) -> Table
Set the separator line color.