Docs
Components/Layout/Table

Table

A data table with sortable columns and rows.

s0 add table

Usage

S0.Table(columns: [
    S0.TableColumn("Name", keyPath: \.name),
    S0.TableColumn("Email", keyPath: \.email),
], rows: users)
S0.Table(columns: [
    S0.TableColumn("Name", keyPath: \.name, sortable: true),
    S0.TableColumn("Age", keyPath: \.age, sortable: true),
], rows: people, valueProvider: { row, col in
    "\(row[keyPath: col])"
})

Parameters

NameTypeDefaultDescription
columns[TableColumn]Array of column definitions.
rows[Row]Array of row data.
valueProvider(Row, String) -> StringClosure that returns the display string for a given row and column key.