suiss/ui ยท Pattern
Table List
Tabular data that renders as a table on desktop and a grouped list on mobile.
Table List is an open-source pattern from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
TableList displays rows of data from a column definition. On desktop it renders a suiss/ui Table inside a bordered section, with a header row and one cell per column. On mobile (below 48rem, via useIsMobile), where wide tables do not fit, it renders an inset grouped list, and each column chooses its place in the row through slot.
Use it for orders, invoices, transactions and other records that people compare in columns on large screens.
Installation
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Usage
Examples
Without title
Leave out title to render the table without a heading or region.
Empty
Set emptyText to change the content shown when rows is empty.
Accessibility
- With a
title, the section is labelled by its heading and exposed as a region. - On desktop the data is a real table with column headers; an empty state is a single cell that spans every column.
- On mobile the rows are list items in a
ul.
API Reference
TableList
The section that renders the rows as a table or a grouped list.
| Prop | Type | Default |
|---|---|---|
rows | T[] | Required |
columns | TableListColumn<T>[] | Required |
getKey | (row: T, index: number) => React.Key | (_, index) => index |
title | React.ReactNode | - |
emptyText | React.ReactNode | "No results." |
Also accepts the props of React.ComponentProps<"section">.
Each TableListColumn has a key, a header and a cell renderer. Optional fields are mobileCell, slot (title, description, trailing or hidden) and align (start or end); the TableListColumn type is exported. align: "end" right-aligns the desktop header and cells.
On mobile, the first title column becomes the primary line, description columns form a secondary line joined with a middle dot, and trailing columns appear at the end. Columns without a slot, or with hidden, are left out on mobile. mobileCell replaces cell on mobile, for example to drop styling that does not fit the list.
Each part sets a data-slot, such as table-list-title or, on mobile, table-list-item, for styling.
Web preview
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
-
Target iOS 17 or later.
-
Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 24 or higher, and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Examples
With flat list
Builds the grouped list in a FlatList: TableListRow is the item, with first and last to round the ends, TableListSeparator is the ItemSeparatorComponent, and TableListHeader and TableListFooter sit around the list.

Accessibility
- The group has the
listrole; rows have thelistitemrole, orbuttonwhenonRowPressis set. TableListTitleandTableListHeaderhave theheadingrole.- Separators are hidden from screen readers.
API Reference
TableListTitle
A large heading above the list.
Also accepts the props of React.ComponentProps<typeof Text>.
TableListHeader
A small uppercase heading above a group.
Also accepts the props of React.ComponentProps<typeof Text>.
TableListFooter
A note below a group.
Also accepts the props of React.ComponentProps<typeof Text>.
TableListSeparator
An inset divider between rows.
Also accepts the props of ViewProps.
TableListRow
One row with a title, description and trailing content.
| Prop | Type | Default |
|---|---|---|
title | React.ReactNode | - |
description | React.ReactNode | - |
trailing | React.ReactNode | - |
first | boolean | false |
last | boolean | false |
children | React.ReactNode | - |
Also accepts the props of React.ComponentProps<typeof Item>.
description is a single line, and trailing text is shown in a secondary color with tabular numbers. first and last round the top and bottom corners.
TableList
Renders rows from a column definition, with an optional title and empty state.
| Prop | Type | Default |
|---|---|---|
rows | T[] | Required |
columns | TableListColumn<T>[] | Required |
getKey | (row: T, index: number) => React.Key | (_, index) => index |
title | React.ReactNode | - |
emptyText | React.ReactNode | "No results." |
onRowPress | (row: T, index: number) => void | - |
Also accepts the props of ViewProps.
Define columns with key, header, cell and slot, plus optional mobileCell and align; the TableListColumn type is exported. 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. The header and align fields are not rendered by the list layout.
Pass onRowPress to make rows pressable; it is called with the row and index. When there are no rows, emptyText is shown in the group.
TableListSlot
Values: .title, .description, .trailing, .hidden.
TableListColumn
| Parameter | Type | Default |
|---|---|---|
_ย key | String | - |
header | LocalizedStringKey | - |
slot | TableListSlot: .title | .description | .trailing | .hidden | .hidden |
cell | (Row) -> Text | - |
| Property | Type |
|---|---|
key | String |
header | LocalizedStringKey |
slot | TableListSlot |
cell | (Row) -> Text |
TableList
Renders rows from a column definition, with an optional title and empty state.
| Parameter | Type | Default |
|---|---|---|
_ย rows | [Row] | - |
id | KeyPath<Row, ID> | - |
columns | [TableListColumn<Row>] | - |
title | LocalizedStringKey? | nil |
emptyText | LocalizedStringKey | "No results." |
action | ((Row) -> Void)? | nil |
Overloads: init(_:id:columns:title:emptyText:action:), init(_:columns:title:emptyText:action:).
TableListGroup
| Parameter | Type | Default |
|---|---|---|
content | () -> Content | - |
TableListRow
One row with a title, description and trailing content.
| Parameter | Type | Default |
|---|---|---|
action | (() -> Void)? | nil |
content | () -> Content | - |
TableListSection
| Parameter | Type | Default |
|---|---|---|
header | LocalizedStringKey? | nil |
footer | LocalizedStringKey? | nil |
content | () -> Content | - |
TableListSlot
Values: Title, Description, Trailing, Hidden.
TableListAlign
Values: Start, End.
TableListColumn
| Parameter | Type | Default |
|---|---|---|
key | String | - |
header | String | - |
slot | TableListSlot?: Title | Description | Trailing | Hidden | null |
align | TableListAlign: Start | End | TableListAlign.Start |
mobileCell | (@Composable (T) -> Unit)? | null |
cell | @Composable (T) -> Unit | - |
TableList
Renders rows from a column definition, with an optional title and empty state.
| Parameter | Type | Default |
|---|---|---|
rows | List<T> | - |
columns | List<TableListColumn<T>> | - |
modifier | Modifier | Modifier |
getKey | (T, Int) -> Any | { _, index -> index } |
title | String? | null |
emptyText | String | "No results." |
onRowClick | ((T) -> Unit)? | null |
TableListTitle
A large heading above the list.
| Parameter | Type | Default |
|---|---|---|
text | String | - |
modifier | Modifier | Modifier |
TableListHeader
A small uppercase heading above a group.
| Parameter | Type | Default |
|---|---|---|
text | String | - |
modifier | Modifier | Modifier |
TableListFooter
A note below a group.
| Parameter | Type | Default |
|---|---|---|
text | String | - |
modifier | Modifier | Modifier |
TableListRow
One row with a title, description and trailing content.
| Parameter | Type | Default |
|---|---|---|
first | Boolean | - |
last | Boolean | - |
modifier | Modifier | Modifier |
onClick | (() -> Unit)? | null |
onLongClick | (() -> Unit)? | null |
enabled | Boolean | true |
selected | Boolean? | null |
content | @Composable () -> Unit | - |
TableListRowText
| Parameter | Type | Default |
|---|---|---|
title | String | - |
description | String? | null |
trailing | String? | null |
TableListSectionScope.item
| Parameter | Type | Default |
|---|---|---|
key | Any? | null |
onClick | (() -> Unit)? | null |
content | @Composable () -> Unit | - |
TableListSectionScope.row
| Parameter | Type | Default |
|---|---|---|
title | String | - |
description | String? | null |
trailing | String? | null |
key | Any? | null |
onClick | (() -> Unit)? | null |
TableListSectionScope.items
| Parameter | Type | Default |
|---|---|---|
items | List<T> | - |
key | ((T) -> Any)? | null |
onClick | ((T) -> Unit)? | null |
content | @Composable (T) -> Unit | - |
TableListScope.title
| Parameter | Type | Default |
|---|---|---|
text | String | - |
TableListScope.section
| Parameter | Type | Default |
|---|---|---|
header | String? | null |
footer | String? | null |
emptyText | String? | null |
content | TableListSectionScope.() -> Unit | - |
tableList
Receiver: LazyListScope.
| Parameter | Type | Default |
|---|---|---|
key | String | "table-list" |
content | TableListScope.() -> Unit | - |
