Table
A typed, column-driven data table with alternating rows, a dark header, and horizontal scroll on overflow. Columns accept a render function for custom cell content - badges, avatars, actions, anything.
Installation
npx stepwise-ui add table
Default
Pagination
Set pageSize and the table pages itself: rows cross-fade between pages, and a footer appears with the page read-out and prev/next arrows. Control it externally with page + onPageChange.
Props - Table
PropTypeDescription
columnsTableColumn<T>[]Column definitions.
rowsT[]Data rows.
getKey(row: T, i: number) => string | numberStable key for each row.
pageSizenumberRows per page. Omit for no pagination.
pagenumberControlled page (1-indexed).
onPageChange(page: number) => voidFires when the user pages.
pageLabel(page, pages) => ReactNodeCustomise the footer read-out.
gridColsstringOverride the auto grid-template-columns.
minWidthstringMin width before horizontal scroll. Default "480px".
Props - TableColumn
PropTypeDescription
keykeyof T | stringRow object key to read.
headerstringColumn heading.
widthstringCSS track size (e.g. "1fr", "120px"). Default "1fr".
render(value, row, index) => ReactNodeCustom cell renderer.