LAYOUT / COMPONENT 38

Table

React component

Compare structured records with sorting, selection, and pagination.

Try it out

Use the live controls or open the Code tab to view and copy the example.

Collections
Status
Essentials24Published
Studio favorites12Draft
Spring collection36Published

API reference

Generated from the package’s TypeScript exports. Standard React event and ARIA attributes are also accepted where the component wraps a native element.

PropTypeDescription
labelRequiredstringA meaningful visible or accessible label.
columnsRequiredTableColumn<T>[]Typed column definitions, renderers and optional sort accessors.
rowsRequiredT[]Records to render. The library does not fetch data.
rowKeyRequired(row: T) => stringReturns a stable unique key for each record.
loadingboolean | undefinedStandard React / HTML attribute passed to the underlying element.
emptyMessagestring | undefinedDefault: "No results found."See the typed definition and working example for this option.
sort{ column: string; direction: "ascending" | "descending"; } | undefinedSee the typed definition and working example for this option.
onSortChange((sort: { column: string; direction: "ascending" | "descending"; }) => void) | undefinedSee the typed definition and working example for this option.
selectedstring[] | undefinedDefault: []See the typed definition and working example for this option.
onSelectionChange((ids: string[]) => void) | undefinedReceives all selected row keys.
pagination{ hasPrevious: boolean; hasNext: boolean; onPrevious: () => void; onNext: () => void; label: string; } | undefinedExternal page state and navigation callbacks.
filtersReactNodeSee the typed definition and working example for this option.

Accessibility & interaction

Generic typed columns, client sorting and controlled selection. Pagination is callback-driven. Tables scroll horizontally on small screens. Virtualization and editable spreadsheet cells are not included.

Visible focus, reduced motion, and both color themes are shared across staqui. Choose labels and document structure that make sense in your application; automated checks do not replace assistive-technology testing.

Variants & implementation notes

Generic typed columns, client sorting and controlled selection. Pagination is callback-driven. Tables scroll horizontally on small screens. Virtualization and editable spreadsheet cells are not included.

Use the typed API above for the supported variants. The example demonstrates the primary composition; shared controls inherit hover, focus, active and disabled treatment where applicable.