suiss/uim · Pattern
Table List
Turns table-style rows and columns into a grouped list of rows with a title, description and trailing values.
Table List is an open-source mobile pattern from suiss/uim: components composed into a flow for React Native and Expo, with SwiftUI and Jetpack Compose versions built from the same design tokens. The @esuiss/uim CLI copies its source into your project, so you own the code.


import { View } from "react-native"
import { TableList, type TableListColumn } from "@/components/patterns/table-list"
type Invoice = {
id: string
customer: string
status: string
method: string
amount: string
}
const invoices: Invoice[] = [
{
id: "INV001",
customer: "Olivia Martin",
status: "Paid",
method: "Card",
amount: "$250.00",
},
{
id: "INV002",
customer: "Jackson Lee",
status: "Pending",
method: "PayPal",
amount: "$150.00",
},
{
id: "INV003",
customer: "Isabella Nguyen",
status: "Unpaid",
method: "Transfer",
amount: "$350.00",
},
{
id: "INV004",
customer: "William Kim",
status: "Paid",
method: "Card",
amount: "$450.00",
},
]
const columns: TableListColumn<Invoice>[] = [
{
key: "customer",
header: "Customer",
cell: (row) => row.customer,
slot: "title",
},
{
key: "status",
header: "Status",
cell: (row) => row.status,
slot: "description",
},
{
key: "method",
header: "Method",
cell: (row) => row.method,
slot: "description",
},
{
key: "amount",
header: "Amount",
cell: (row) => row.amount,
slot: "trailing",
align: "end",
},
]
export function TableListExample() {
return (
<View className="gap-8">
<TableList
title="Invoices"
rows={invoices}
columns={columns}
getKey={(row) => row.id}
onRowPress={() => {}}
/>
<TableList rows={[]} columns={columns} emptyText="No invoices yet." />
</View>
)
}import EsuissUI
import SwiftUI
struct TableListExample: View {
var body: some View {
VStack(alignment: .leading, spacing: 32) {
TableList(tableListInvoices, columns: tableListColumns, title: "Invoices", action: { _ in })
TableList([TableListInvoice](), columns: tableListColumns, emptyText: "No invoices yet.")
}
}
}
struct TableListInvoice: Identifiable {
let id: String
let customer: String
let status: String
let method: String
let amount: String
}
let tableListInvoices = [
TableListInvoice(id: "INV001", customer: "Olivia Martin", status: "Paid", method: "Card", amount: "$250.00"),
TableListInvoice(id: "INV002", customer: "Jackson Lee", status: "Pending", method: "PayPal", amount: "$150.00"),
TableListInvoice(id: "INV003", customer: "Isabella Nguyen", status: "Unpaid", method: "Transfer", amount: "$350.00"),
TableListInvoice(id: "INV004", customer: "William Kim", status: "Paid", method: "Card", amount: "$450.00"),
]
let tableListColumns: [TableListColumn<TableListInvoice>] = [
TableListColumn("customer", header: "Customer", slot: .title) { Text(verbatim: $0.customer) },
TableListColumn("status", header: "Status", slot: .description) { Text(verbatim: $0.status) },
TableListColumn("method", header: "Method", slot: .description) { Text(verbatim: $0.method) },
TableListColumn("amount", header: "Amount", slot: .trailing) { Text(verbatim: $0.amount) },
]import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Text
import com.esuiss.ui.patterns.TableList
import com.esuiss.ui.patterns.TableListAlign
import com.esuiss.ui.patterns.TableListColumn
import com.esuiss.ui.patterns.TableListSlot
class TableListInvoice(
val id: String,
val customer: String,
val status: String,
val method: String,
val amount: String,
)
val tableListInvoices = listOf(
TableListInvoice("INV001", "Olivia Martin", "Paid", "Card", "$250.00"),
TableListInvoice("INV002", "Jackson Lee", "Pending", "PayPal", "$150.00"),
TableListInvoice("INV003", "Isabella Nguyen", "Unpaid", "Transfer", "$350.00"),
TableListInvoice("INV004", "William Kim", "Paid", "Card", "$450.00"),
)
val tableListColumns = listOf(
TableListColumn<TableListInvoice>("customer", "Customer", slot = TableListSlot.Title) { Text(it.customer, maxLines = 1) },
TableListColumn<TableListInvoice>("status", "Status", slot = TableListSlot.Description) { Text(it.status, maxLines = 1) },
TableListColumn<TableListInvoice>("method", "Method", slot = TableListSlot.Description) { Text(it.method, maxLines = 1) },
TableListColumn<TableListInvoice>("amount", "Amount", slot = TableListSlot.Trailing, align = TableListAlign.End) {
Text(it.amount, maxLines = 1)
},
)
@Composable
fun TableListDefault() {
Column(verticalArrangement = Arrangement.spacedBy(32.dp)) {
TableList(
rows = tableListInvoices,
columns = tableListColumns,
getKey = { row, _ -> row.id },
title = "Invoices",
onRowClick = {},
)
TableList(rows = emptyList(), columns = tableListColumns, emptyText = "No invoices yet.")
}
}TableList takes rows and a columns definition, and renders each row as a TableListRow inside one rounded group. Each column has a slot that decides where its cell goes: the row title, the description line, the trailing side, or nowhere.
The row parts are also exported, so you can build the same grouped look inside a FlatList for long or virtualized lists.
Installation
$ pnpm dlx @esuiss/uim@latest add table-list$ pnpm dlx @esuiss/uim@latest add table-list --platform swift$ pnpm dlx @esuiss/uim@latest add table-list --platform kotlinThe CLI also adds what it builds on: Item, Text.
Manual
- Install the dependencies:
npx expo install cnimport { cn } from "cn"
import * as React from "react"
import { View, type ViewProps } from "react-native"
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemTitle,
} from "@/components/ui/item"
import { Text } from "@/components/ui/text"
type TableListColumn<T> = {
key: string
header: React.ReactNode
cell: (row: T) => React.ReactNode- Update the import paths to match your project.
- Install the dependencies:
npx expo install cnimport { cn } from "cn"
import * as React from "react"
import { View, type ViewProps } from "react-native"
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemTitle,
} from "@/components/ui/item"
import { Text } from "@/components/ui/text"
type TableListColumn<T> = {
key: string
header: React.ReactNode
cell: (row: T) => React.ReactNode- Update the import paths to match your project.
import * as React from "react"
import { StyleSheet, View, type ViewProps } from "react-native"
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemTitle,
} from "@/components/ui/item"
import { Text } from "@/components/ui/text"
import { fontSize, radius, useTheme } from "@/components/ui/theme"
type TableListColumn<T> = {
key: string
header: React.ReactNode
cell: (row: T) => React.ReactNode- Update the import paths to match your project.
-
Target iOS 17 or later.
-
Copy the theme files every view uses:
import SwiftUI
import UIKit
struct RGBA: Sendable {
let red: CGFloat
let green: CGFloat
let blue: CGFloat
let alpha: CGFloat
init(_ hex: UInt32, _ alpha: CGFloat = 1) {
red = CGFloat((hex >> 16) & 0xFF) / 255
green = CGFloat((hex >> 8) & 0xFF) / 255
blue = CGFloat(hex & 0xFF) / 255
self.alpha = alpha
}import SwiftUI
extension Color {
public static let surface = Color.adaptive(light: .init(0xFFFFFF), dark: .init(0x000000))
public static let surfaceSecondary = Color.adaptive(light: .init(0xF5F5F7), dark: .init(0x161617))
public static let surfaceTertiary = Color.adaptive(light: .init(0xE8E8ED), dark: .init(0x2C2C2E))
public static let surfaceRaised = Color.adaptive(light: .init(0xFFFFFF), dark: .init(0x1D1D1F))
public static let label = Color.adaptive(light: .init(0x1D1D1F), dark: .init(0xF5F5F7))
public static let labelSecondary = Color.adaptive(light: .init(0x6E6E73), dark: .init(0xA1A1A6))
public static let labelTertiary = Color.adaptive(light: .init(0x86868B), dark: .init(0x86868B))
public static let labelQuaternary = Color.adaptive(light: .init(0xD2D2D7), dark: .init(0x424245))
public static let control = Color.adaptive(light: .init(0x000000, 0.04), dark: .init(0xFFFFFF, 0.1))
public static let controlPressed = Color.adaptive(light: .init(0x000000, 0.12), dark: .init(0xFFFFFF, 0.22))
public static let controlSelected = Color.adaptive(light: .init(0x1D1D1F), dark: .init(0xF5F5F7))
public static let controlDisabled = Color.adaptive(light: .init(0x000000, 0.03), dark: .init(0xFFFFFF, 0.05))
public static let onControlSelected = Color.adaptive(light: .init(0xFFFFFF), dark: .init(0x000000))- Copy the source and every file it uses:
import SwiftUI
public enum TableListSlot: CaseIterable, Sendable {
case title, description, trailing, hidden
}
public struct TableListColumn<Row> {
public let key: String
public let header: LocalizedStringKey
public let slot: TableListSlot
public let cell: (Row) -> Text
public init(
_ key: String,
header: LocalizedStringKey,
slot: TableListSlot = .hidden,import SwiftUI
public enum ItemVariant: CaseIterable, Sendable {
case `default`, outline, muted
}
public enum ItemSize: CaseIterable, Sendable {
case `default`, sm, xs
var horizontalPadding: CGFloat {
switch self {
case .default: 16
case .sm: 14
case .xs: 12
}
}import SwiftUI
public struct Separator: View {
let orientation: Axis
public init(_ orientation: Axis = .horizontal) {
self.orientation = orientation
}
public var body: some View {
Rectangle()
.fill(Color.separator)
.frame(width: orientation == .vertical ? 1 : nil, height: orientation == .horizontal ? 1 : nil)
.frame(maxWidth: orientation == .horizontal ? .infinity : nil, maxHeight: orientation == .vertical ? .infinity : nil)
.accessibilityHidden(true)
}import SwiftUI
public enum TextVariant: CaseIterable, Sendable {
case `default`, h1, h2, h3, h4, p, blockquote, code, lead, large, small, muted
var style: TextStyle {
switch self {
case .h1: .xl3
case .h2: .xl2
case .h3: .xl
case .h4, .lead, .large: .lg
case .code, .small, .muted: .sm
default: .base
}
}- Add the files to your app target.
- Set
minSdkto 24 or higher and add the dependencies:
implementation(platform("androidx.compose:compose-bom:2026.09.00"))
implementation("androidx.compose.foundation:foundation")
implementation("androidx.compose.ui:ui")
implementation("com.adamglin:phosphor-icon-android:1.0.0")- Copy the theme files every view uses:
package com.esuiss.ui.theme
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.dropShadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.graphics.shadow.Shadow as DropShadow
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.LineHeightStyle
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffsetpackage com.esuiss.ui.theme
import androidx.compose.runtime.Immutable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
@Immutable
data class Colors(
val surface: Color,
val surfaceSecondary: Color,
val surfaceTertiary: Color,
val surfaceRaised: Color,
val label: Color,
val labelSecondary: Color,
val labelTertiary: Color,
val labelQuaternary: Color,- Copy the source and every file it uses:
package com.esuiss.ui.patterns
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.BasicText
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProviderpackage com.esuiss.ui.components
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsPressedAsState
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShapepackage com.esuiss.ui.components
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.CornerSize
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.Immutablepackage com.esuiss.ui.components
import androidx.compose.runtime.compositionLocalOf
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
val LocalContentStyle = compositionLocalOf { TextStyle.Default }
val LocalContentColor = compositionLocalOf { Color.Unspecified }
val LocalIconSize = compositionLocalOf { 20.dp }package com.esuiss.ui.components
import androidx.compose.animation.core.animate
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsPressedAsState
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.BasicText
import androidx.compose.runtime.Composablepackage com.esuiss.ui.components
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.takeOrElse
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.Dp
import com.esuiss.ui.theme.EsuissTheme
@Composable
fun Icon(
imageVector: ImageVector,package com.esuiss.ui.components
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsPressedAsState
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxWidth- Update the
com.esuiss.uipackage names to match your project.
Usage
import { TableListTitle, TableListHeader, TableListFooter, TableListSeparator, TableListRow, TableList } from "@/components/patterns/table-list"<View className="gap-8">
<TableList
title="Invoices"
rows={invoices}
columns={columns}
getKey={(row) => row.id}
onRowPress={() => {}}
/>
<TableList rows={[]} columns={columns} emptyText="No invoices yet." />
</View>Define columns with key, header, cell and slot. Several description columns are joined with ·, and several trailing columns are shown side by side. Use mobileCell to render a different value than cell in the list, such as a shorter date.
Pass onRowPress to make rows pressable. When there are no rows, emptyText is shown in the group. The TableListColumn type is exported.
With a FlatList, use TableListRow as the item, pass first and last to round the ends, TableListSeparator as ItemSeparatorComponent, and TableListHeader and TableListFooter around the list.
Examples
With flat list
Builds the grouped list in a FlatList with a header, footer and separators.


import { FlatList } from "react-native"
import { TableListFooter, TableListHeader, TableListRow, TableListSeparator } from "@/components/patterns/table-list"
type Invoice = {
id: string
customer: string
status: string
method: string
amount: string
}
const invoices: Invoice[] = [
{
id: "INV001",
customer: "Olivia Martin",
status: "Paid",
method: "Card",
amount: "$250.00",
},
{
id: "INV002",
customer: "Jackson Lee",
status: "Pending",
method: "PayPal",
amount: "$150.00",
},
{
id: "INV003",
customer: "Isabella Nguyen",
status: "Unpaid",
method: "Transfer",
amount: "$350.00",
},
{
id: "INV004",
customer: "William Kim",
status: "Paid",
method: "Card",
amount: "$450.00",
},
]
export function TableListWithFlatListExample() {
return (
<FlatList
data={invoices}
keyExtractor={(item) => item.id}
ListHeaderComponent={<TableListHeader>Recent</TableListHeader>}
ListFooterComponent={
<TableListFooter>Payments settle within two days.</TableListFooter>
}
ItemSeparatorComponent={TableListSeparator}
renderItem={({ item, index }) => (
<TableListRow
first={index === 0}
last={index === invoices.length - 1}
title={item.customer}
description={item.status}
trailing={item.amount}
onPress={() => {}}
/>
)}
/>
)
}import EsuissUI
import SwiftUI
struct TableListWithFlatListExample: View {
var body: some View {
TableListSection(header: "Recent", footer: "Payments settle within two days.") {
ForEach(tableListInvoices) { invoice in
TableListRow(action: {}) {
VStack(alignment: .leading, spacing: 2) {
Text(verbatim: invoice.customer)
.textStyle(.base)
.foregroundStyle(Color.label)
.lineLimit(1)
Text(verbatim: invoice.status)
.textStyle(.sm)
.foregroundStyle(Color.labelSecondary)
.lineLimit(1)
}
.frame(maxWidth: .infinity, alignment: .leading)
Text(verbatim: invoice.amount)
.textStyle(.base)
.monospacedDigit()
.foregroundStyle(Color.labelSecondary)
.lineLimit(1)
.fixedSize()
}
}
}
}
}
struct TableListInvoice: Identifiable {
let id: String
let customer: String
let status: String
let method: String
let amount: String
}
let tableListInvoices = [
TableListInvoice(id: "INV001", customer: "Olivia Martin", status: "Paid", method: "Card", amount: "$250.00"),
TableListInvoice(id: "INV002", customer: "Jackson Lee", status: "Pending", method: "PayPal", amount: "$150.00"),
TableListInvoice(id: "INV003", customer: "Isabella Nguyen", status: "Unpaid", method: "Transfer", amount: "$350.00"),
TableListInvoice(id: "INV004", customer: "William Kim", status: "Paid", method: "Card", amount: "$450.00"),
]import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.esuiss.ui.patterns.TableListFooter
import com.esuiss.ui.patterns.TableListHeader
import com.esuiss.ui.patterns.TableListRow
import com.esuiss.ui.patterns.TableListRowText
class TableListInvoice(
val id: String,
val customer: String,
val status: String,
val method: String,
val amount: String,
)
val tableListInvoices = listOf(
TableListInvoice("INV001", "Olivia Martin", "Paid", "Card", "$250.00"),
TableListInvoice("INV002", "Jackson Lee", "Pending", "PayPal", "$150.00"),
TableListInvoice("INV003", "Isabella Nguyen", "Unpaid", "Transfer", "$350.00"),
TableListInvoice("INV004", "William Kim", "Paid", "Card", "$450.00"),
)
@Composable
fun TableListWithFlatList() {
LazyColumn(Modifier.fillMaxWidth().heightIn(max = 640.dp)) {
item(key = "header") { TableListHeader("Recent") }
itemsIndexed(tableListInvoices, key = { _, item -> item.id }) { index, item ->
TableListRow(first = index == 0, last = index == tableListInvoices.lastIndex, onClick = {}) {
TableListRowText(item.customer, item.status, item.amount)
}
}
item(key = "footer") { TableListFooter("Payments settle within two days.") }
}
}API Reference
TableListTitle
A large heading above the list.
React.ComponentProps<typeof Text>TableListHeader
A small uppercase heading above a group.
React.ComponentProps<typeof Text>TableListFooter
A note below a group.
React.ComponentProps<typeof Text>TableListSeparator
An inset divider between rows.
ViewPropsTableListRow
One row with a title, description and trailing content.
React.ComponentProps<typeof Item>- About
- The row's main text.
- Type
React.ReactNode- Default
- —
- About
- A single-line secondary text.
- Type
React.ReactNode- Default
- —
- About
- Content on the end side; text is shown in secondary color with tabular numbers.
- Type
React.ReactNode- Default
- —
- About
- Rounds the top corners.
- Type
boolean- Default
- false
- About
- Rounds the bottom corners.
- Type
boolean- Default
- false
- Type
React.ReactNode- Default
- —
TableList
Renders rows from a column definition, with an optional title and empty state.
ViewProps- About
- The data to render.
- Type
T[]- Default
- required
- About
- Column definitions with
key,header,cell, optionalmobileCell,slotandalign. - Type
TableListColumn<T>[]- Default
- required
- About
- Returns a unique key for a row. Defaults to the index.
- Type
(row: T, index: number) => React.Key- Default
- (_, index) => index
- About
- Heading shown above the list.
- Type
React.ReactNode- Default
- —
- About
- Content shown when
rowsis empty. Defaults toNo results.. - Type
React.ReactNode- Default
- "No results."
- About
- Called with the row and index when a row is pressed.
- Type
(row: T, index: number) => void- Default
- —
Accessibility
- The group has the
listrole; rows have thelistitemrole, orbuttonwhenonRowPressis set. TableListTitleandTableListHeaderhave theheadingrole.- Separators are hidden from screen readers.
Notes
- Rows use
bg-surface-secondaryandbg-surface-tertiarywhen pressed. - The
headerandaligncolumn fields are not rendered by the list layout.