Package-level declarations

Types

Link copied to clipboard
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.

Link copied to clipboard

Builder for a single editable ColumnSpec. Extends ReadonlyColumnBuilder with editing capabilities.

Link copied to clipboard

DSL builder for a list of editable ColumnSpec.

Link copied to clipboard
@RequiresOptIn(message = "This table library API is experimental and may change without notice. Opt in with @OptIn(ExperimentalTableApi::class).", level = RequiresOptIn.Level.ERROR)
annotation class ExperimentalTableApi
Link copied to clipboard
open class ReadonlyColumnBuilder<T : Any, C, E>

Builder for a single readonly ColumnSpec.

Link copied to clipboard

Type alias for readonly table columns (without table data)

Link copied to clipboard

DSL builder for a list of readonly ColumnSpec.

Link copied to clipboard

Scope available inside table body cell content.

Link copied to clipboard

Scope available for a rendered table item.

Functions

Link copied to clipboard
context(cellScope: TableCellScope)
fun Modifier.draggableHandle(enabled: Boolean = true, interactionSource: MutableInteractionSource? = null, onDragStarted: (startedPosition: Offset) -> Unit = {}, onDragStopped: () -> Unit = {}, dragGestureDetector: DragGestureDetector = DragGestureDetector.Press): Modifier

Makes this modifier act as a drag handle for the current table item from cell content.

Link copied to clipboard
fun <T : Any, C, E> EditableTable(itemsCount: Int, itemAt: (Int) -> 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, onRowMove: (fromIndex: Int, toIndex: Int) -> 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, rowEmbedded: @Composable (rowIndex: Int, item: T) -> Unit? = null, embedded: Boolean = false, onRowEditStart: (item: T, rowIndex: Int) -> Unit? = null, onRowEditComplete: (rowIndex: Int) -> Boolean? = null, onEditCancelled: (rowIndex: Int) -> Unit? = null)

Composable editable data table that renders a header and a virtualized list of rows.

Link copied to clipboard
fun <T : Any, C, E> editableTableColumns(build: EditableTableColumnsBuilder<T, C, E>.() -> Unit): ImmutableList<ColumnSpec<T, C, E>>

DSL entry to declare editable table columns.

Link copied to clipboard
context(cellScope: TableCellScope)
fun Modifier.longPressDraggableHandle(enabled: Boolean = true, interactionSource: MutableInteractionSource? = null, onDragStarted: (startedPosition: Offset) -> Unit = {}, onDragStopped: () -> Unit = {}): Modifier

Makes this modifier act as a long-press drag handle for the current table item from cell content.

Link copied to clipboard
fun <T : Any, C> Table(itemsCount: Int, itemAt: (Int) -> 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, onRowMove: (fromIndex: Int, toIndex: Int) -> 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, rowEmbedded: @Composable (rowIndex: Int, item: T) -> Unit? = null, embedded: Boolean = false)

Composable read-only data table that renders a header and a virtualized list of rows.

fun <T : Any, C, E> Table(itemsCount: Int, itemAt: (Int) -> 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, onRowMove: (fromIndex: Int, toIndex: Int) -> 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, rowEmbedded: @Composable (rowIndex: Int, item: T) -> Unit? = null, embedded: Boolean = false)

Composable data table with custom table data state.

Link copied to clipboard
fun <T : Any, C, E> TableActiveFilters(columns: ImmutableList<ColumnSpec<T, C, E>>, state: TableState<C>, strings: StringProvider = DefaultStrings, modifier: Modifier = Modifier, includeClearAllChip: Boolean = true)

Renders a compact header row with chips describing currently active filters. Provides quick clear actions for individual columns or all at once.

Link copied to clipboard
fun <T : Any, C, E> tableColumns(build: ReadonlyTableColumnsBuilder<T, C, E>.() -> Unit): ImmutableList<ColumnSpec<T, C, E>>

DSL entry to declare readonly table columns with custom table data type.