Toggle Sidebar B
AppearanceLight & dark mode D

Table Data

Batteries-included data table built on TanStack Table. Pass columns, data, and a paginator meta object; you get search, sort, filter, pagination, row selection, bulk actions, and column visibility out of the box. For static tables, use the primitive Table.

Default

Five rows with TanStack column definitions and a Laravel-style paginator meta.

Dark previewReplay preview
Invoice
Customer
Status
Amount
INV-001Olivia MartinPaid$250.00
INV-002Jackson LeePending$150.00
INV-003Isabella NguyenUnpaid$350.00
INV-004Sofia DavisPaid$450.00
INV-005Liam BrownPaid$120.00
Showing 1 to 5 of 5 results.

Reorder rows

Set draggableRows and the table injects a handle column, binds the drag, and emits reorder with a new array in the order it now shows. Nothing else moves to the call site: no handle to draw, no sortable to wire, no rule to remember.

Dragging switches itself off while the rows on screen are not the stored list in its stored order - a search, a column filter or a sort - because a drop would then write positions read off a filtered view. That also means a reorderable table has to pass an empty initialSorting, or it is born sorted and can never be dragged.

The handle is a button, so the keyboard reaches it: focus it and the up and down arrow keys move the row one step at a time. Give each row a stable id (or name your key with rowKey) - selection and expansion are keyed by it, and without one they follow positions instead of records.

Dark previewReplay preview
Reorder
Stage
Owner
DiscoveryOlivia Martin
ProposalJackson Lee
NegotiationIsabella Nguyen
OnboardingSofia Davis

Row actions

Put a TableRowActions in the actions column and the row gets its menu twice: under the ellipsis at the end of the row, and under the pointer when the row is right-clicked (a long press on touch). The items are written once as TableRowActionsItem, and each renders as a dropdown item or a context-menu item depending on which menu is drawing it.

A mouse right-click on a field, or on text that is already selected, still opens the browser's own menu, so paste and copy keep working there. A right-click on a link opens the row menu too, with Open in new tab for that link at the top. A table without TableRowActions keeps the browser's menu everywhere, and so does a row whose items are all conditioned out.

Dialogs stay with the component that owns the row's state, outside TableRowActions. If you mount them lazily, latch on open - it fires from either menu.

Dark previewReplay preview
Invoice
Customer
Amount
Actions
INV-001Olivia Martin$250.00
INV-002Jackson Lee$150.00
INV-003Isabella Nguyen$350.00

Right-click a row, or open its menu from the ellipsis.

API Reference

TableData

PropTypeDefaultDescription
columnsColumnDef[]TanStack Table column definitions. Use accessorKey for data fields and id for custom columns like select / actions. header and cell accept strings or render functions.
dataRow[]Row data array.
metaPaginatorMetaLaravel-style paginator metadata: { current_page, per_page, total, last_page, from, to }.
modelstringResource slug used for query-string keys and add-button label.
labelstringSingular label shown in the add button and empty state.
pendingbooleanfalseShow skeleton rows while data loads.
errorError | string | nullnullRender an error block above the table.
searchablebooleantrueShow the search input.
columnTogglebooleantrueShow the column visibility menu.
initialSortingSortingState[{ id: 'created_at', desc: true }]Initial sort. Override when your data has no created_at column, and pass [] on a reorderable table - dragging is off while a sort is applied.
initialPaginationPaginationState{ pageIndex: 0, pageSize: 10 }Initial page index and size.
draggableRowsbooleanfalseReorder rows by dragging. Injects the handle column as the first column, and emits reorder. Needs the whole list in data (client-only mode): in server mode data is one page, so the emitted indices are page-local.
dragDisabledbooleanfalseYour own gate on top of the table's - a permission, usually. The handle column still renders, greyed out, so the table does not change shape per account.
rowKeystring"id"Field that identifies a row. TanStack keys row selection and expansion by it; without one they are keyed by position, so a refetch or a reorder hands the checkbox to whichever record landed in that seat.
EventDescription
refreshFired when the user clicks the refresh button.
update:paginationFired when the page index or size changes.
update:sortingFired when sort state changes.
update:columnFiltersFired when column filters change.
update:rowSelectionFired when row selection changes.
reorderFired after a drag or an arrow-key move, with { items, from, to }. items is a new array in the order the table now shows; your own array is left alone, so take items as the new value if anything else reads it.
SlotDescription
filtersSlot for custom filter UI. Receives { table }.
add-buttonSlot for a custom add button in the toolbar.
actionsToolbar actions on the right.
bulk-actionsToolbar shown when rows are selected.

TableRowActions

PropTypeDefaultDescription
labelstring"Row actions"Accessible name of the ellipsis button.
align"start" | "center" | "end""end"Where the dropdown lines up against the ellipsis. The right-click menu always opens at the pointer.
EventDescription
openFired whenever this row's menu opens, from the ellipsis or from a right-click. Latch on it to mount dialogs on first use rather than once per row.
SlotDescription
defaultTableRowActionsItem and TableRowActionsSeparator entries.

TableRowActionsItem

PropTypeDefaultDescription
tostring | RouteLocationRawnullInternal link. It renders as a real anchor, so cmd-click and middle-click still open a new tab.
hrefstringnullExternal link.
targetstringnullLink target. "_blank" adds rel="noopener noreferrer".
iconstringnullIcon drawn before the label.
variant"default" | "destructive""default"Destructive entries take the destructive colour.
disabledbooleanfalseGreyed out and skipped by the keyboard.
loadingbooleanfalseSwaps the icon for a spinner and disables the entry while the work runs.
EventDescription
selectFired when the entry is chosen. The menu closes afterwards.
SlotDescription
defaultThe label.
iconReplaces the icon, for one that needs its own colour.