Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

267 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Table for Compose Multiplatform (Material 3)

Maven Central

Compose Multiplatform data table with Material 3 look & feel. Includes a core table (table-core), a conditional formatting add‑on (table-format), and paging integration (table-paging).

Data Table Example

Documentation

Full documentation lives at https://white-wind-llc.github.io/table/Getting started · Guides · API reference · Live demo

Installation

Add the modules you need from Maven Central:

dependencies {
    implementation("ua.wwind.table-kmp:table-core:2.3.2")
    // optional
    implementation("ua.wwind.table-kmp:table-format:2.3.2")
    implementation("ua.wwind.table-kmp:table-paging:2.3.2")
}

Quick start

data class Person(val name: String, val age: Int)
enum class PersonField { Name, Age }

val columns = tableColumns<Person, PersonField, Unit> {
    column(PersonField.Name, valueOf = { it.name }) {
        header("Name")
        cell { person, _ -> Text(person.name) }
        sortable()
        filter(TableFilterType.TextTableFilter())
    }
    column(PersonField.Age, valueOf = { it.age }) {
        header("Age")
        cell { person, _ -> Text(person.age.toString()) }
        sortable()
    }
}

val state = rememberTableState(
    columns = columns.map { it.key },
    settings = TableSettings(stripedRows = true),
)

@Composable
fun PeopleTable(items: List<Person>) {
    Table(
        itemsCount = items.size,
        itemAt = { index -> items.getOrNull(index) },
        state = state,
        columns = columns,
    )
}

License

See LICENSE.

Releases

Contributors

Languages