Data table
TanStack Table works out the rows: sorted, filtered, paged and selected. Keyline's table parts draw them. You give it rows and columns; selecting a row re-renders that row alone.
Loading the live example…
npx shadcn@latest add @keyline-ui/data-table-orders"use client";
import { Button } from "../ui/button";
import {
DataTable,
DataTableBulkBar,
DataTablePagination,
DataTableSearch,
useDataTable,
type DataTableColumnDef,
} from "../ui/data-table";
import { Status, TableFrame, TableScroll, TableToolbar } from "../ui/table";
import type { StatusKind } from "../ui/status";
type State = "out" | "loading" | "held" | "delivered";
type Order = { id: string; client: string; rep: string; cases: number; due: string; state: State };
const ORDERS: Order[] = [
{ id: "DM-4102", client: "Scranton Business Park", rep: "Dwight", cases: 40, due: "2026-11-12", state: "out" },
{ id: "DM-4107", client: "Lackawanna County", rep: "Dwight", cases: 120, due: "2026-11-12", state: "out" },
{ id: "DM-4111", client: "Vance Refrigeration", rep: "Phyllis", cases: 6, due: "2026-11-11", state: "held" },
{ id: "DM-4115", client: "Blue Cross of Pennsylvania", rep: "Jim", cases: 60, due: "2026-11-13", state: "loading" },
{ id: "DM-4118", client: "Harper Collins", rep: "Stanley", cases: 24, due: "2026-11-16", state: "loading" },
{ id: "DM-4120", client: "Scranton White Pages", rep: "Andy", cases: 10, due: "2026-11-09", state: "delivered" },
{ id: "DM-4123", client: "Mount Airy Casino", rep: "Jim", cases: 35, due: "2026-11-17", state: "loading" },
{ id: "DM-4126", client: "Lackawanna County", rep: "Dwight", cases: 80, due: "2026-11-10", state: "delivered" },
{ id: "DM-4129", client: "Penn Paper Supply", rep: "Phyllis", cases: 15, due: "2026-11-11", state: "held" },
{ id: "DM-4131", client: "Wilkes-Barre Library", rep: "Stanley", cases: 18, due: "2026-11-18", state: "out" },
{ id: "DM-4134", client: "Sabre", rep: "Andy", cases: 300, due: "2026-11-19", state: "loading" },
];
const SAY: Record<State, [StatusKind, string]> = {
loading: ["waiting", "Loading"],
out: ["normal", "Out for delivery"],
held: ["attention", "Held"],
delivered: ["done", "Delivered"],
};
const day = new Intl.DateTimeFormat("en-US", { weekday: "short", month: "short", day: "numeric", timeZone: "UTC" });
// module scope: the columns stay the same object from render to render
const COLUMNS: DataTableColumnDef<Order>[] = [
{
accessorKey: "id",
header: "Order",
cell: ({ getValue }) => <span className="font-kl-mono text-[13px]">{getValue() as string}</span>,
},
{ accessorKey: "client", header: "Client" },
{ accessorKey: "rep", header: "Rep", enableSorting: false },
{ accessorKey: "cases", header: "Cases", sortDescFirst: true, meta: { align: "end" } },
{
accessorKey: "due",
header: "Due",
cell: ({ getValue }) => day.format(new Date(getValue() as string)),
},
{
accessorKey: "state",
header: "Status",
enableSorting: false,
enableGlobalFilter: false,
cell: ({ getValue }) => {
const [kind, say] = SAY[getValue() as State];
return <Status kind={kind}>{say}</Status>;
},
},
];
export function OrdersDataTable() {
const table = useDataTable({
data: ORDERS,
columns: COLUMNS,
defaultState: { sorting: [{ id: "due", desc: false }], pagination: { pageIndex: 0, pageSize: 5 } },
});
return (
<TableFrame>
<TableToolbar>
<DataTableSearch table={table} label="Search orders" placeholder="Search orders" />
</TableToolbar>
<DataTableBulkBar
table={table}
scope={(n) => (n ? `${n} of ${ORDERS.length} orders` : "Select orders to act on them")}
>
{(n) => (
<Button layout="cell" disabled={n === 0} onClick={() => table.resetRowSelection()}>
Clear
</Button>
)}
</DataTableBulkBar>
<TableScroll>
<DataTable
table={table}
aria-label="Open orders"
rowLabel={(row) => `Select ${row.original.id}`}
empty={{ title: "No orders match", body: "Try another client, order or rep." }}
/>
</TableScroll>
<DataTablePagination table={table} noun="orders" />
</TableFrame>
);
}When to use
Use it when rows need sorting, filtering, paging and selection worked out for you, on TanStack Table. For a table whose data and state you manage yourself use Table.
Installation
npx shadcn@latest add @keyline-ui/data-tableRun it where your components.json is. The first time, map the @keyline-ui registry: one command, in Installation. The file it adds is on GitHub.
It installs @tanstack/react-table at the version Keyline is tested with, and the table item.
Usage
import {
DataTable, DataTableBulkBar, DataTablePagination, DataTableSearch, useDataTable,
type DataTableColumnDef,
} from "@/components/keyline/ui/data-table"
import { TableFrame, TableScroll, TableToolbar } from "@/components/keyline/ui/table"const columns: DataTableColumnDef<Order>[] = [
{ accessorKey: "id", header: "Order" },
{ accessorKey: "client", header: "Client" },
{ accessorKey: "cases", header: "Cases", sortDescFirst: true, meta: { align: "end" } },
]
function Orders({ orders }: { orders: Order[] }) {
const table = useDataTable({ data: orders, columns })
return (
<TableFrame>
<TableToolbar>
<DataTableSearch table={table} label="Search orders" />
</TableToolbar>
<DataTableBulkBar table={table} scope={(n) => `${n} of ${orders.length} orders`} />
<TableScroll>
<DataTable table={table} aria-label="Orders" rowLabel={(row) => `Select ${row.original.id}`} />
</TableScroll>
<DataTablePagination table={table} noun="orders" />
</TableFrame>
)
}Define the columns outside the component, or in a useMemo: a new array rebuilds every column. Shift on a header adds it as a further sort level, and Shift on a checkbox selects the range from the last row you toggled.
Controlled state
The table keeps seven slices: sorting, columnFilters, globalFilter, pagination, rowSelection, columnVisibility and expanded. Pass a slice in state to own it, and write back what onStateChange gives you. The rest stay the table's. onStateChange reports those too, so you can follow them without owning them.
const [sorting, setSorting] = useState<DataTableState["sorting"]>([{ id: "due", desc: false }])
const table = useDataTable({
data: orders,
columns,
// the sort is yours; every other slice stays the table's
state: { sorting },
onStateChange: (next, { slice }) => {
if (slice === "sorting") setSorting(next.sorting)
},
// a slice you leave to the table starts here
defaultState: { pagination: { pageIndex: 0, pageSize: 25 } },
})State in the URL
An adapter is a pair of functions between the state and the address bar. This one is an example to copy and adapt; the item does not include it, and a router's search params work the same way.
// An example adapter, not part of the item: keep the sort, search and page in the address bar.
function readUrl(params: URLSearchParams): Partial<DataTableState> {
const sort = params.get("sort") // "due,-cases": a minus sorts descending
return {
sorting: sort
? sort.split(",").map((s) => ({ id: s.replace(/^-/, ""), desc: s.startsWith("-") }))
: [],
globalFilter: params.get("q") ?? "",
pagination: { pageIndex: Number(params.get("page") ?? 1) - 1, pageSize: 25 },
}
}
function writeUrl(state: DataTableState): string {
const params = new URLSearchParams()
if (state.sorting.length)
params.set("sort", state.sorting.map((s) => (s.desc ? "-" : "") + s.id).join(","))
if (state.globalFilter) params.set("q", state.globalFilter)
if (state.pagination.pageIndex) params.set("page", String(state.pagination.pageIndex + 1))
return params.size ? `?${params}` : location.pathname
}
function Orders({ orders }: { orders: Order[] }) {
const [url, setUrl] = useState(() => readUrl(new URLSearchParams(location.search)))
const table = useDataTable({
data: orders,
columns,
state: url,
onStateChange: (next) => {
setUrl({ sorting: next.sorting, globalFilter: next.globalFilter, pagination: next.pagination })
history.replaceState(null, "", writeUrl(next))
},
})
// …render as above
}Filters
filterFn: "keyline" filters a column by a DataTableFilter: text (ignoring case and accents), a set of values, or a range of numbers or dates. A filter with nothing in it removes itself.
const columns: DataTableColumnDef<Shipment>[] = [
// a DataTableFilter: { kind: "text", value } · { kind: "set", values } · { kind: "range", from?, to? }
{ accessorKey: "carrier", header: "Carrier", filterFn: "keyline" },
{ accessorKey: "eta", header: "ETA", filterFn: "keyline", sortingFn: "datetime" },
]
table.getColumn("carrier")?.setFilterValue({ kind: "set", values: ["DHL", "UPS"] })
table.getColumn("eta")?.setFilterValue({ kind: "range", from: monday, to: friday })Keyboard and screen readers
Each sort header is a button: Enter or Space sorts, Shift adds a level. The first sorted column carries aria-sort; later levels say their place, “sort 2 of 2, descending”. Selected rows carry aria-selected, and the bulk bar announces its count politely. Name the table with aria-label or caption.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
bodyProps | TypePartProps<"tbody", Record<string, never>> | Default— | Props for the body (a ref for useRowMotion). |
caption | TypeReactNode | Default— | The table's name, read before its rows (a TableCaption). |
empty | Type{ title: ReactNode; body?: ReactNode; action?: ReactNode; count?: ReactNode; } | Default— | What shows when no row passes the filters (an Empty spanning the grid). |
error | Type{ title: ReactNode; body?: ReactNode; action?: ReactNode; count?: ReactNode; } | Default— | Data failed to load: an error row (announced) in place of the rows. |
expandLabel | Type(row: DataTableRowInstance<TData>, expanded: boolean) => string | DefaultdetailLabel | The expand toggle's name for a row. Default: "Show details" / "Hide details". |
loading | Typeboolean | Default— | While data loads: a page of loading rows in place of the rows (mark the frame aria-busy). |
renderDetail | Type(row: DataTableRowInstance<TData>) => ReactNode | Default— | A row's detail, shown under it while it is expanded (the expanded slice). Adds an expand column; the row's index cell spans its detail. Keep the function stable: a new one re-renders every row. |
rowCode | Type(row: DataTableRowInstance<TData>, index: number) => ReactNode | Default— | The index column's code for a row: its place across pages ("01") by default; null prints none. |
rowLabel | Type(row: DataTableRowInstance<TData>) => string | Default— | The selection checkbox's name for a row ("Select SH-20481"). Default: "Select row" and its code. |
rowProps | Type(row: DataTableRowInstance<TData>) => Omit<TableRowProps, "selected" | "expanded"> | Default— | Props for a row's TableRow (an onClick, a data attribute). Keep the function stable: a new one re-renders every row. |
selectAllLabel | Typestring | Default"Select this page" | The select-all checkbox's name. |
table | TypeOmit<Table<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TData>, "store"> & { readonly store: ReadonlyStore<TableState_ColumnFiltering & TableState_ColumnVisibility & TableState_GlobalFiltering & TableState_RowExpanding & TableState_RowPagination & TableState_RowSelection & TableState_RowSorting>; Subscribe: { <TSourceValue>(props: { source: SubscribeSource<TSourceValue>; selector?: undefined; children: ReactNode | ((state: TSourceValue) => ReactNode); }): ReactNode | Promise<ReactNode>; <TSourceValue, TSubSelected>(props: { source: SubscribeSource<TSourceValue>; selector: (state: TSourceValue) => TSubSelected; children: ReactNode | ((state: TSubSelected) => ReactNode); }): ReactNode | Promise<ReactNode>; <TSubSelected>(props: Omit<SubscribePropsWithStore<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TSubSelected>, "source">): ReactNode | Promise<ReactNode>; }; FlexRender: <TValue extends CellData = unknown>(props: FlexRenderProps<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TData, TValue>) => ReactNode; readonly state: Readonly<any>; } | Defaultrequired | — |
useDataTable | Type{ data, columns, state?, onStateChange?, defaultState?, getRowId?, enableRowSelection?, getRowCanExpand?, autoResetPageIndex?, autoResetExpanded? } | Default— | Returns the TanStack table. A slice in state is yours; any other is the table's, seeded from defaultState. getRowId defaults to the row's id. Set autoResetPageIndex and autoResetExpanded to false to keep the page and the open details when the data changes. |
onStateChange | Type(state: DataTableState, { slice }) => void | Default— | Every change, controlled or not, with the slice that changed. |
DataTable | Type{ table, rowLabel?, selectAllLabel?, rowCode?, rowProps?, renderDetail?, expandLabel?, bodyProps?, caption?, loading?, error?, empty? } | Default— | The grid: sort headers, the index column, the rows, and empty when nothing matches. renderDetail adds an expand column and a detail under each expanded row; loading and error stand in for the rows; bodyProps go to the body (a ref for useRowMotion). Other props go to the table element. |
DataTableBulkBar | Type{ table, scope?, children? } | Default— | The selected count, announced politely. scope and children may be functions of the count. |
DataTablePagination | Type{ table, noun?, loading? } | Default— | The range of rows and previous / next. |
DataTableSearch | Type{ table, label? } | Default— | A search over every column, the table's global filter. |
column meta | Type{ align?: "end", cellClassName?: string } | Default— | End-aligns a column of figures; cellClassName goes to its body cells. sortDescFirst starts its sort high to low. |
Parts API
The props each part declares beyond the element or Base UI part it renders.
DataTableBulkBar
The bulk bar over a Data Table's selection: the count (announced politely), the scope, the actions. It re-renders on its own when the selection changes.
| Prop | Type | Default | Description |
|---|---|---|---|
children | TypeReactNode | ((count: number) => ReactNode) | Default— | the actions; a function of the selected count (to disable them at 0) |
scope | TypeReactNode | ((count: number) => ReactNode) | Default— | what the selection covers; a function of the selected count |
table | TypeOmit<Table<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TData>, "store"> & { readonly store: ReadonlyStore<TableState_ColumnFiltering & TableState_ColumnVisibility & TableState_GlobalFiltering & TableState_RowExpanding & TableState_RowPagination & TableState_RowSelection & TableState_RowSorting>; Subscribe: { <TSourceValue>(props: { source: SubscribeSource<TSourceValue>; selector?: undefined; children: ReactNode | ((state: TSourceValue) => ReactNode); }): ReactNode | Promise<ReactNode>; <TSourceValue, TSubSelected>(props: { source: SubscribeSource<TSourceValue>; selector: (state: TSourceValue) => TSubSelected; children: ReactNode | ((state: TSubSelected) => ReactNode); }): ReactNode | Promise<ReactNode>; <TSubSelected>(props: Omit<SubscribePropsWithStore<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TSubSelected>, "source">): ReactNode | Promise<ReactNode>; }; FlexRender: <TValue extends CellData = unknown>(props: FlexRenderProps<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TData, TValue>) => ReactNode; readonly state: Readonly<any>; } | Defaultrequired | — |
DataTablePagination
The pager over a Data Table: the range of rows shown, the page, previous and next.
| Prop | Type | Default | Description |
|---|---|---|---|
children | TypeReactNode | Default— | fills the cell between the range and the buttons (a ToastDock) |
className | Typestring | Default— | — |
loading | Typeboolean | Default— | while data loads the range shows "–" and the buttons are off |
noun | Typestring | Default— | what the rows are ("shipments") |
table | TypeOmit<Table<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TData>, "store"> & { readonly store: ReadonlyStore<TableState_ColumnFiltering & TableState_ColumnVisibility & TableState_GlobalFiltering & TableState_RowExpanding & TableState_RowPagination & TableState_RowSelection & TableState_RowSorting>; Subscribe: { <TSourceValue>(props: { source: SubscribeSource<TSourceValue>; selector?: undefined; children: ReactNode | ((state: TSourceValue) => ReactNode); }): ReactNode | Promise<ReactNode>; <TSourceValue, TSubSelected>(props: { source: SubscribeSource<TSourceValue>; selector: (state: TSourceValue) => TSubSelected; children: ReactNode | ((state: TSubSelected) => ReactNode); }): ReactNode | Promise<ReactNode>; <TSubSelected>(props: Omit<SubscribePropsWithStore<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TSubSelected>, "source">): ReactNode | Promise<ReactNode>; }; FlexRender: <TValue extends CellData = unknown>(props: FlexRenderProps<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TData, TValue>) => ReactNode; readonly state: Readonly<any>; } | Defaultrequired | — |
DataTableSearch
The toolbar's search box, bound to the table's global filter (every column's text).
| Prop | Type | Default | Description |
|---|---|---|---|
table | TypeOmit<Table<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TData>, "store"> & { readonly store: ReadonlyStore<TableState_ColumnFiltering & TableState_ColumnVisibility & TableState_GlobalFiltering & TableState_RowExpanding & TableState_RowPagination & TableState_RowSelection & TableState_RowSorting>; Subscribe: { <TSourceValue>(props: { source: SubscribeSource<TSourceValue>; selector?: undefined; children: ReactNode | ((state: TSourceValue) => ReactNode); }): ReactNode | Promise<ReactNode>; <TSourceValue, TSubSelected>(props: { source: SubscribeSource<TSourceValue>; selector: (state: TSourceValue) => TSubSelected; children: ReactNode | ((state: TSubSelected) => ReactNode); }): ReactNode | Promise<ReactNode>; <TSubSelected>(props: Omit<SubscribePropsWithStore<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TSubSelected>, "source">): ReactNode | Promise<ReactNode>; }; FlexRender: <TValue extends CellData = unknown>(props: FlexRenderProps<{ rowSortingFeature: TableFeature; sortedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; sortFns: { alphanumeric: CreatedSortFn<any, any>; basic: CreatedSortFn<any, any>; datetime: CreatedSortFn<any, any>; text: CreatedSortFn<any, any>; }; columnFilteringFeature: TableFeature; globalFilteringFeature: TableFeature; filteredRowModel: (table: Table<any, any>) => () => RowModel<any, any>; filterFns: { keyline: CreatedFilterFn<any, any>; search: CreatedFilterFn<any, any>; }; rowPaginationFeature: TableFeature; paginatedRowModel: (table: Table<any, any>) => () => RowModel<any, any>; rowSelectionFeature: TableFeature; rowExpandingFeature: TableFeature; columnVisibilityFeature: TableFeature; }, TData, TValue>) => ReactNode; readonly state: Readonly<any>; } | Defaultrequired | — |
useDataTable returns TanStack's own table, so its API works as documented there: table.getColumn(id), table.resetRowSelection(), table.getSelectedRowModel().