Package-level declarations
Types
Link copied to clipboard
Link copied to clipboard
data class KTableColumn<T>(val key: String, val header: String, val weight: Float = 1.0f, val sortable: Boolean = false, val align: TextAlign = TextAlign.Start, val cell: @Composable RowScope.(row: T) -> Unit)
Describes one column in a KDataTable preset.
Functions
Link copied to clipboard
fun <T> KDataTable(columns: List<KTableColumn<T>>, data: List<T>, modifier: Modifier = Modifier, striped: Boolean = false, pageSize: Int = Int.MAX_VALUE, onSort: (key: String, direction: KSortDirection) -> Unit? = null, emptyContent: @Composable () -> Unit = {
Box(
modifier = Modifier.fillMaxWidth().padding(32.dp),
contentAlignment = Alignment.Center
) {
Text("No results.", color = MaterialTheme.colorScheme.onSurfaceVariant, fontSize = 14.sp)
}
})
Convenience data-table built on top of the primitive Table slots.
Link copied to clipboard
Shadcn/ui-style Table root — mirrors Table from table.tsx.
Link copied to clipboard
Wraps body TableRows — mirrors TableBody (<tbody>).
Link copied to clipboard
Caption rendered below the table — mirrors TableCaption (<caption>).
Link copied to clipboard
Footer section — mirrors TableFooter (<tfoot>).
Link copied to clipboard
fun RowScope.TableHead(modifier: Modifier = Modifier, weight: Float = 1.0f, align: TextAlign = TextAlign.Start, sortable: Boolean = false, sortDirection: KSortDirection = KSortDirection.None, onSort: () -> Unit? = null, content: @Composable RowScope.() -> Unit)
Header cell — mirrors TableHead (<th>).
Link copied to clipboard
Wraps header TableRows — mirrors TableHeader (<thead>).