Skip to content

Android components Data display

StanceDataTable

Beta

A simple table that scrolls horizontally when columns do not fit.

  • PlatformAndroid, Jetpack Compose
  • Builds onA custom Stance component
  • Kindcomposable

Preview

Rendered by the Jetpack Compose library, not drawn by hand.

StanceDataTable on AndroidStanceDataTable on AndroidStanceDataTable on Android
StanceDataTable, Light appearance
Light
StanceDataTable, Dark appearance
Dark
StanceDataTable, High contrast appearance
High contrast

Usage

kotlin
data class User(val name: String, val team: String, val deployments: Int)
StanceDataTable(
    columns = listOf(
        StanceTableColumn<User>("Name") { it.name },
        StanceTableColumn("Team") { it.team },
        StanceTableColumn("Deployments", numeric = true) { it.deployments.toString() },
    ),
    rows = listOf(User("Priya Nair", "Sales", 14), User("Hana Sato", "Finance", 9)),
    caption = "Organisation users",
)

Accessibility

  • Headers are headings.
  • Rows are read as header and value pairs.

On other platforms