Components / Data

Table native

A data table of typed columns over rows: sorting, row selection, widths, alignment, windowed; a slot column renders a component per cell.

Children
none
Loading the renderer…
Table rendered by the React renderer on Web
Web React
Table rendered by the SwiftUI renderer on iOS
iOS SwiftUI
Table rendered by the Compose renderer on Android
Android Compose
Table rendered by the gpui renderer on Desktop
Desktop gpui

View exponential-ui-table, painted by each native renderer.

striped
density · default
density · compact
PropTypeDefaultDescription
columnsrequired[column]–The columns in order.
rowsrequiredbind[object]–One object per row keyed by column key; bind it for live data.
rowKeystring"id"The row field that identifies a row.
sortbindsort–The active sort; bound = you order rows, unbound = sorted locally.
selectablenone | single | multiple"none"Row selection (many = a checkbox column).
selectedbind[string]–The selected row keys; bind them.
captionstring–A caption under the table.
emptyTextstring"$string.noResults"Shown when there are no rows.
stripedbooleanfalseAlternates row fills.
densitydefault | compact"default"Row height class.
stickyHeaderbooleanfalseKeeps the header visible while the rows scroll.
NameKind
on.sortevent: runs an action
on.selectevent: runs an action
on.rowPressevent: runs an action
*slot: one component by id
Role
table
Semantics
table (grid when selectable): columnheader with aria-sort, row with aria-selected
KeysAction
EnterSpace on a sortable headercycle the sort (asc, desc)
Space on a row checkboxtoggle the row; on the header checkbox: select all
Enter on a focused rowrowPress
–Tab moves through headers, checkboxes and cell controls
Recipe parts
Table/rootTable/captionTable/headerTable/headerCellTable/sortIconTable/rowTable/cellTable/checkboxTable/emptyTable/body
Keyed by
selectablestripeddensitystickyHeaderalign:hover:pressed:focus:disabled:checked:open:selected:invalid:dragover

Themes · Write a theme