React Native · Components
Table
Data table (same API as web).
Live example
The preview runs in the browser with the web component; the native component takes the same props and looks the same on iOS and Android.
Preview
| Orders | Status | |||
|---|---|---|---|---|
| #1027 | Can Öztürk | Paid | Oct 9, 2026 | $980.00 |
| #1026 | Zeynep Demir | Paid | Oct 4, 2026 | $250.00 |
| #1025 | Mehmet Kaya | Pending | Oct 3, 2026 | $1,420.00 |
| #1024 | Ayşe Yılmaz | Paid | Oct 1, 2026 | $250.00 |
| Total | 2900 |
Code
Events
- Events appear here when you interact with the preview.
Import
Table
componentData table (same API as web). Columns come via columns, rows via rows; header, cells, card view, formatting, sorting and pagination come built in.
- Column widths are estimated from content (no measuring, no flicker); if the table is wider than the screen it scrolls horizontally, if narrower the columns widen proportionally.
- On phones each row turns into a card (
stackOnMobile), with the column name before each value. - With
format, numbers, currency, percentages and dates are formatted by locale; numbers are right-aligned with tabular digits. - Sorting is controlled (
sort+onSortChange) or uncontrolled. - For large data (thousands of rows, editing, filters) use
DataGrid.
Examples
TableFormat
typeBuilt-in formats of a cell value. Numbers are formatted by locale.
TableColumn
interfaceA Table column (same fields as web).
| Name | Type | Description |
|---|---|---|
key | string | Column id; if value is omitted, the value of this field in the row is shown. |
header | ReactNode | Header cell. |
tooltip? | TooltipProp | Tooltip shown with ⓘ next to the header (on long press). |
mobileLabel? | string | Name written before the value in card view. Defaults to the text header. |
value? | (row: T) => unknown | Produces the cell value from the row (sorting and formatting use it too). |
render? | (row: T, index: number) => ReactNode | Fully customizes the cell content (e.g. a badge, a button). |
format? | TableFormat | Built-in format: number, currency, percent (0.25 → 25%), date. |
align? | "start" | "center" | "end" | Alignment. Defaults to "end" for numeric formats. |
sortable? | boolean | Can be sorted by this column by tapping the header. |
width? | number | `${number}%` | Column width: dp or percent ("20%"). If omitted it is estimated from the content (140 for render columns); if the table is narrower than the screen columns widen proportionally, if wider it scrolls horizontally. |
hideOnMobile? | boolean | Hidden in card view. |
style? | StyleProp<ViewStyle> | Style of this column's cells. |
TableSort
interfaceSort state.
| Name | Type | Description |
|---|---|---|
key | string | key of the sorted column. |
direction | "asc" | "desc" | Direction. |
TableStyles
interfaceStyles of the Table inner parts (counterpart of classNames on web).
| Name | Type | Description |
|---|---|---|
container? | StyleProp<ViewStyle> | Scroll container. |
header? | StyleProp<ViewStyle> | Header row. |
row? | StyleProp<ViewStyle> | Each data row (each card in card view). |
footer? | StyleProp<ViewStyle> | Footer (totals) row. |
wrapper? | StyleProp<ViewStyle> | Container wrapping the table and the pagination. |
TablePagination
typeThe Table pagination prop: same as PaginationProps. If total (or pageCount, hasNext) is omitted, rows is the full record set and the table slices the current page itself after sorting (it also keeps the page state); if given, rows is only that page.
TableProps
interfaceProps of the Table component.
| Name | Type | Default | Description |
|---|---|---|---|
columns | readonly TableColumn<T>[] | Columns. | |
rows | readonly T[] | Rows. | |
rowKey? | keyof T | ((row: T, index: number) => string | number) | Unique row key: a field name or a function. Defaults to id, then the index. | |
caption? | ReactNode | Caption under the table (on top in card view). | |
empty? | ReactNode | the `tableEmpty` text (`"Kayıt yok"`) | Content shown when there are no rows. |
footer? | Partial<Record<string, ReactNode>> | Footer row content by column key (e.g. totals). | |
stackOnMobile? | boolean | true | Turns each row into a card on narrow screens (below 640 dp). |
stickyHeader? | boolean | The header row stays on top during vertical scrolling; use with maxHeight. | |
maxHeight? | number | Maximum height of the table body; beyond it rows scroll inside. | |
label? | string | Screen reader name. | |
sort? | TableSort | null | Sorting (controlled). If omitted the table keeps the state itself (defaultSort). | |
defaultSort? | TableSort | null | Initial sorting (uncontrolled). | |
onSortChange? | (sort: TableSort | null) => void | Called with the new sorting when a sortable header is tapped. | |
onRowPress? | (row: T, index: number) => void | Makes rows pressable (e.g. go to details). onRowClick on web. | |
selectedKey? | string | number | null | The row with this key looks selected. | |
locale? | string | {@link UIProvider} `locale | Locale used for formatting. |
currency? | string | {@link UIProvider} `currency | Currency. |
pagination? | TablePagination | Pagination below the table. See TablePagination. | |
styles? | TableStyles | Styles of the inner parts. | |
style? | StyleProp<ViewStyle> | Container style. | |
testID? | string | Test id. |