compose-material-data-table

Implements a flexible Material 2 Data Table with features like column width settings, sorting, various column types, filtering, pagination, and scrolling capabilities for enhanced data representation.

Android
JVM
iOS
Wasm
GitHub stars66
Dependents0
LicenseMIT License
Creation dateover 1 year ago

Last activity11 months ago
Latest release1.2.2 (over 1 year ago)

maven central version

A Kotlin & Compose Multiplatform implementation of the Material 2 Data Table.

image

Setup

Using libs.versions.toml

To add the dependency to your Kotlin Multiplatform project, open the build.gradle.kts of your shared module, then

kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation(libs.composematerialdatatable)
        }
    }
}

and, in your libs.versions.toml, add:

composematerialdatatable = "1.2.2"

[libraries]
composematerialdatatable = { module = "io.github.aleksandar-stefanovic:composematerialdatatable", version.ref = "composematerialdatatable" }

Using direct dependency notation

kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation("io.github.aleksandar-stefanovic:composematerialdatatable:1.2.2")
        }
    }
}

Features

  • Column width settings
    • Fixed — the column with use the specified width
    • Wrap Content — the column will spread to the intrinsic width of the content
    • Flex — the column will use remaining available space, split across all Flex columns by weight
  • Sorting — click on the table header to toggle between sorting ascending, descending, and resetting
  • Column types
    • String
    • Int
    • Double
    • Date
    • Dropdown (specific set of values)
    • Checkbox (Boolean)
  • Cell editing (for now, String, Int, Double, Checkbox and Dropdown types are supported, with Date support coming soon)
  • Column aligning
  • Text selection (works but selecting multiple cells at once just concatenates them without whitespace at the moment)
  • Toggleable selection column (first column with tri-state checkbox header and checkbox cells, which emits events on interaction)
  • Filtering
  • Client-based pagination
  • Horizontal and vertical scrolling

For the planned features, see Issues.

Supported platforms

Right now, it is tested and working on:

  • Desktop
  • Android
  • WASM (with the limitation of not having number formatting)
  • iOS

Example

Gradle submodule sample contains a working example of the Table implementation, see Sample App.kt.

Android
JVM
iOS
Wasm
GitHub stars66
Dependents0
LicenseMIT License
Creation dateover 1 year ago

Last activity11 months ago
Latest release1.2.2 (over 1 year ago)

maven central version

A Kotlin & Compose Multiplatform implementation of the Material 2 Data Table.

image

Setup

Using libs.versions.toml

To add the dependency to your Kotlin Multiplatform project, open the build.gradle.kts of your shared module, then

kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation(libs.composematerialdatatable)
        }
    }
}

and, in your libs.versions.toml, add:

composematerialdatatable = "1.2.2"

[libraries]
composematerialdatatable = { module = "io.github.aleksandar-stefanovic:composematerialdatatable", version.ref = "composematerialdatatable" }

Using direct dependency notation

kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation("io.github.aleksandar-stefanovic:composematerialdatatable:1.2.2")
        }
    }
}

Features

  • Column width settings
    • Fixed — the column with use the specified width
    • Wrap Content — the column will spread to the intrinsic width of the content
    • Flex — the column will use remaining available space, split across all Flex columns by weight
  • Sorting — click on the table header to toggle between sorting ascending, descending, and resetting
  • Column types
    • String
    • Int
    • Double
    • Date
    • Dropdown (specific set of values)
    • Checkbox (Boolean)
  • Cell editing (for now, String, Int, Double, Checkbox and Dropdown types are supported, with Date support coming soon)
  • Column aligning
  • Text selection (works but selecting multiple cells at once just concatenates them without whitespace at the moment)
  • Toggleable selection column (first column with tri-state checkbox header and checkbox cells, which emits events on interaction)
  • Filtering
  • Client-based pagination
  • Horizontal and vertical scrolling

For the planned features, see Issues.

Supported platforms

Right now, it is tested and working on:

  • Desktop
  • Android
  • WASM (with the limitation of not having number formatting)
  • iOS

Example

Gradle submodule sample contains a working example of the Table implementation, see Sample App.kt.