A multiplaform Jetpack Compose library that provides a @Composable
table
with automatic layouts.
- 2-dimension scrolling
- Automatic cell width and height calculation using the largest one
- Maximum cell width/height could be optionally specified
- Allowing custom composable and action listeners (e.g. clickable) for each cell
- Infinite table width and height
- Sticky rows and columns
- Straight-forward to use
- Lazy cells
- Grid lines (have to be implemented by users themselves inside cells)
- Android
- Desktop (JVM - Windows/MacOS/Linux)
- iOS
- WASM (JS)
For multiplatform:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.sunny-chung:composable-table:<version>")
// ...
For single platform:
dependencies {
// ...
implementation("io.github.sunny-chung:composable-table:<version>")
}
Below shows an example of minimal usage.
Table(
rowCount = 100,
columnCount = 10
) { rowIndex, columnIndex ->
Text("($rowIndex, $columnIndex)")
}
Please read the demo app for a practical usage example. There is a demo app for each platform.
Since v1.2.0, Composable Table moves to Maven Central to provide multiplatform support.
Dependency identifier is changed from com.github.sunny-chung:composable-table
to
io.github.sunny-chung:composable-table
.
Users using old version can stay at v1.1.0 because no other change is introduced. You can upgrade to v1.2.0 by changing the dependency identifier and version name to enjoy multiplatform support.
If maxCellWidthDp
or maxCellHeightDp
is specified, please do not use fillMaxXXX
modifiers
in the root composable of cells, or the cell would occupy maximum size unconditionally.
This behaviour is documented in the fillMaxXXX
methods of the Compose Foundation library.
Contributions are welcomed!
Please also raise an issue if you think a must-have feature is missing!