Skip to content
PixiKit

Sort Table

A data table that works on its own: it sorts, searches with highlighted matches, selects rows with a bulk bar, groups, expands rows, pages and hides columns, and it can also report each of those to a server. Rows glide when the order changes.

pixikit.com/docs/app-ui/lists/sort-table

Customize

Caption hidden
Searchable
Selectable
Expandable
Paginate
Page size6
Manual
Density
Striped
Rules
Surface
Sticky header
Height
Column menu
Responsive
Loading

Props

40
NameTypeDefaultDescription
columnsSortColumn[]RequiredThe columns, in order.
rowsSortRow[]RequiredThe records. With `manual`, only the ones on the current page.
getRowId(row: SortRow) => string(row) => String(row.id)Reads a row's unique id. Default: its `id` key.
captionstringNoneThe table's title, read by screen readers.
captionHiddenbooleanfalseKeeps the caption for screen readers only.
sortSortStateNoneThe sorted column and direction; `null` for none. Makes the sort controlled.
defaultSortSortStateNoneThe sort to start with.
onSortChange(sort: SortState) => voidNoneCalled when a header click changes the sort.
searchablebooleanfalseShows a search field that filters the text columns.
searchstringNoneThe search text. Makes it controlled.
onSearchChange(search: string) => voidNoneCalled as the search text changes.
selectablebooleanfalseAdds a checkbox to every row and a select all box to the header.
selectedstring[]NoneThe selected row ids. Makes the selection controlled.
defaultSelectedstring[]NoneThe ids selected to start with.
onSelectedChange(ids: string[]) => voidNoneCalled with the new ids when the selection changes.
bulkActionsSortAction[][]Buttons in the bar that slides in when rows are selected.
onBulkAction(action: string, ids: string[]) => voidNoneCalled with the action and the selected ids.
rowActionsSortAction[][]Items of the menu at the end of every row.
onRowAction(action: string, row: SortRow) => voidNoneCalled with the action and its row.
groupBystringNoneThe id of a column to group the rows by. Groups can collapse.
expandablebooleanfalseLets a row open to show `renderExpanded`.
renderExpanded(row: SortRow) => ReactNodeNoneThe detail shown under an open row.
paginatebooleanfalseSplits the rows into pages under the table.
pagenumberNoneThe current page, from 1. Makes it controlled.
pageSizenumber10Rows per page.
onPageChange(page: number) => voidNoneCalled with the new page.
manualbooleanfalseLeaves sorting, searching and paging to you: the table only reports them.
totalnumberNoneWith `manual`, the number of rows in all pages.
density"comfortable" | "compact""comfortable"Row height.
stripedbooleanfalseTints every second row.
rules"rows" | "grid" | "none""rows"The lines between cells.
surface"plain" | "card""card"`card` frames the table in a bordered card.
stickyHeaderbooleanfalseKeeps the header in view while the rows scroll. Give `height` too.
heightnumberNoneThe most the table grows before its rows scroll, in px.
columnMenubooleanfalseShows a Columns button that hides and shows columns.
responsive"hide" | "stack" | "scroll""scroll"`hide` drops low priority columns, `stack` turns rows into cards, `scroll` scrolls sideways.
loadingbooleanfalseShows placeholder rows while the data loads.
emptyReactNodeNoneShown when there are no rows.
localestring"en-US"The language numbers, dates and sorting use.
classNamestringNone

Related