ColumnSpec

data class ColumnSpec<T : Any, C, E>(val key: C, val header: @Composable (E) -> Unit, val cell: @Composable context(TableCellScope) BoxScope.(T, E) -> Unit, val valueOf: (T) -> Any?, val title: @Composable () -> String? = null, val sortable: Boolean = false, val resizable: Boolean = true, val visible: Boolean = true, val width: Dp? = null, val minWidth: Dp = 10.dp, val autoWidth: Boolean = false, val autoMaxWidth: Dp? = null, val alignment: Alignment = Alignment.CenterStart, val minRowHeight: Dp? = null, val maxRowHeight: Dp? = null, val filter: TableFilterType<*>? = null, val groupHeader: @Composable BoxScope.(Any?) -> Unit? = null, val headerDecorations: Boolean = true, val headerClickToSort: Boolean = true, val editable: Boolean = false, val canStartEdit: (T, Int) -> Boolean? = null, val editCell: @Composable BoxScope.(T, E, onComplete: () -> Unit) -> Unit? = null, val footer: @Composable BoxScope.(E) -> Unit? = null)

Declarative specification of a table column.

Contains header/cell content, sizing, alignment, sorting and filtering capabilities.

Parameters

key

unique column key

header

composable content for the header cell; receives table state data

cell

composable content for each row cell

valueOf

function that extracts the comparable value of this column from T; used for grouping and other logic

title

optional plain-text title for use in places like active filter chips

sortable

whether the column participates in sorting

resizable

whether user can resize the column

visible

whether column is currently visible

width

preferred width override; null uses table defaults

minWidth

minimal width when resizable

autoWidth

whether to auto-fit width to measured content after first render

autoMaxWidth

optional cap for auto-fitted width

alignment

alignment for cell content

minRowHeight

optional minimal row height when table uses dynamic row height

maxRowHeight

optional maximal row height when table uses dynamic row height

filter

optional filter type provided by this column

groupHeader

optional custom renderer for the group header

headerDecorations

whether to render built-in sort/filter icons in the header cell

headerClickToSort

whether clicking the entire header cell toggles sorting

footer

optional composable content for the footer cell; receives table state data

Constructors

Link copied to clipboard
constructor(key: C, header: @Composable (E) -> Unit, cell: @Composable context(TableCellScope) BoxScope.(T, E) -> Unit, valueOf: (T) -> Any?, title: @Composable () -> String? = null, sortable: Boolean = false, resizable: Boolean = true, visible: Boolean = true, width: Dp? = null, minWidth: Dp = 10.dp, autoWidth: Boolean = false, autoMaxWidth: Dp? = null, alignment: Alignment = Alignment.CenterStart, minRowHeight: Dp? = null, maxRowHeight: Dp? = null, filter: TableFilterType<*>? = null, groupHeader: @Composable BoxScope.(Any?) -> Unit? = null, headerDecorations: Boolean = true, headerClickToSort: Boolean = true, editable: Boolean = false, canStartEdit: (T, Int) -> Boolean? = null, editCell: @Composable BoxScope.(T, E, onComplete: () -> Unit) -> Unit? = null, footer: @Composable BoxScope.(E) -> Unit? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Optional callback to check if editing can start for a specific item. Returns true to allow, false to deny.

Link copied to clipboard
val cell: @Composable context(TableCellScope) BoxScope.(T, E) -> Unit
Link copied to clipboard

Whether this column supports editing. Only applies if table's editingEnabled is true.

Link copied to clipboard
val editCell: @Composable BoxScope.(T, E, onComplete: () -> Unit) -> Unit?

Composable slot for editing UI. Receives the item, table data, and an onComplete callback to signal edit completion. Table data allows access to shared state (e.g., validation errors, aggregated values).

Link copied to clipboard
Link copied to clipboard

Optional composable content for the footer cell; receives table state data

Link copied to clipboard
Link copied to clipboard
val header: @Composable (E) -> Unit
Link copied to clipboard

Whether a click on the whole header cell should toggle sort when sortable.

Link copied to clipboard

Whether to render default header decorations (sort/filter icons) provided by the table.

Link copied to clipboard
val key: C
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val title: @Composable () -> String?
Link copied to clipboard
val valueOf: (T) -> Any?
Link copied to clipboard
Link copied to clipboard
val width: Dp?