Table

fun <T : Any, C, E> Table(items: PagingData<T>?, state: TableState<C>, columns: ImmutableList<ColumnSpec<T, C, E>>, tableData: E, modifier: Modifier = Modifier, placeholderRow: @Composable () -> Unit? = null, rowKey: (item: T?, index: Int) -> Any = { _, i -> i }, onRowClick: (T) -> Unit? = null, onRowLongClick: (T) -> Unit? = null, contextMenu: @Composable (item: T, pos: Offset, dismiss: () -> Unit) -> Unit? = null, customization: TableCustomization<T, C> = DefaultTableCustomization(), colors: TableColors = TableDefaults.colors(), strings: StringProvider = DefaultStrings, verticalState: LazyListState = rememberLazyListState(), horizontalState: ScrollState = rememberScrollState(), icons: TableHeaderIcons = TableHeaderDefaults.icons(), shape: Shape = RoundedCornerShape(4.dp), border: BorderStroke? = null)

Composable data table with paging support.

This overload wraps PagingData and delegates to the core Table composable.

  • Columns are described by columns (ColumnSpec).

  • Data is provided via items (PagingData).

  • Sorting, filters, ordering and selection are controlled by state.

Generic parameters:

  • T actual row item type.

  • C column key type.

  • E table data type - shared state accessible in headers, footers, and edit cells.

Parameters

items

paging data container with loaded items

state

mutable table state (sorting, filters, order, selection)

columns

list of visible/available column specifications

tableData

current table data instance - accessible in headers, footers, and edit cells

modifier

layout modifier for the whole table

placeholderRow

optional row content shown when an item is null

rowKey

stable key for rows; defaults to index

onRowClick

row primary action handler

onRowLongClick

optional long-press handler

contextMenu

optional context menu host, invoked with item and absolute position

customization

styling hooks for rows and cells

colors

container/content colors

strings

string provider for UI text

verticalState

list scroll state

horizontalState

horizontal scroll state of the whole table

icons

header icons used for sort and filter affordances

shape

surface shape of the table

border

outer border stroke; null uses theme default, TableDefaults.NoBorder disables border


fun <T : Any, C> Table(items: PagingData<T>?, state: TableState<C>, columns: ImmutableList<ColumnSpec<T, C, Unit>>, modifier: Modifier = Modifier, placeholderRow: @Composable () -> Unit? = null, rowKey: (item: T?, index: Int) -> Any = { _, i -> i }, onRowClick: (T) -> Unit? = null, onRowLongClick: (T) -> Unit? = null, contextMenu: @Composable (item: T, pos: Offset, dismiss: () -> Unit) -> Unit? = null, customization: TableCustomization<T, C> = DefaultTableCustomization(), colors: TableColors = TableDefaults.colors(), strings: StringProvider = DefaultStrings, verticalState: LazyListState = rememberLazyListState(), horizontalState: ScrollState = rememberScrollState(), icons: TableHeaderIcons = TableHeaderDefaults.icons(), shape: Shape = RoundedCornerShape(4.dp), border: BorderStroke? = null)

Composable data table with paging support.

This overload wraps PagingData and delegates to the core Table composable.

  • Columns are described by columns (ColumnSpec).

  • Data is provided via items (PagingData).

  • Sorting, filters, ordering and selection are controlled by state.

Generic parameters:

  • T actual row item type.

  • C column key type.

Parameters

items

paging data container with loaded items

state

mutable table state (sorting, filters, order, selection)

columns

list of visible/available column specifications

modifier

layout modifier for the whole table

placeholderRow

optional row content shown when an item is null

rowKey

stable key for rows; defaults to index

onRowClick

row primary action handler

onRowLongClick

optional long-press handler

contextMenu

optional context menu host, invoked with item and absolute position

customization

styling hooks for rows and cells

colors

container/content colors

strings

string provider for UI text

verticalState

list scroll state

horizontalState

horizontal scroll state of the whole table

icons

header icons used for sort and filter affordances

shape

surface shape of the table

border

outer border stroke; null uses theme default, TableDefaults.NoBorder disables border