Skip to content
DataInteractive playground

DataTable

Data with search, sorting, selection and pagination.

Preparing the playground…
Text and Markdown example
DataTable · Example
1<DataTable columns={[{accessorKey:"name",header:"Name"},{accessorKey:"role",header:"Role"}]} data={[{name:"Sofía Martín",role:"Design"},{name:"Lucas García",role:"Development"},{name:"Emma Wilson",role:"Product"}]} searchable paginated pageSize={2} />
Read documentation in Markdown

How to use it

Define columns using accessorKey and header and pass data as an array. Columns use LegacyColumnDef from the TanStack version included in Kivora.

Import

React / Next.js
1import { DataTable } from "@kivora/nextjs";

Interactive examples run inside a component with "use client". The playground's Copy button includes the imports needed for the current example.

API reference 0.2.0

Types from the installed published version, including component properties and common HTML attributes. “Optional” does not imply a default value; omitting a property lets the component decide.

PropertyTypeDescription
columnsRequiredLegacyColumnDef<TData, unknown>[]Column definitions, data access and presentation.
dataRequiredTData[]Rows to display.
advancedbooleanConfigures advanced. The type describes the supported values and structure.
aria-labelstringAccessible name of the control.
bulkActionsDataTableBulkAction<TData>[]Configures bulkActions. The type describes the supported values and structure.
childrenReactNodeContent or child elements of the component.
classNamestringAdditional CSS classes to customize the element.
defaultCheckedbooleanInitial selection of the control.
defaultValuestring | number | readonly string[]Initial value when the component manages its own state.
emptyMessageReactNodeContent when there are no results.
filterablebooleanEnable filters.
filterMenuOpenbooleanConfigures filterMenuOpen. The type describes the supported values and structure.
filtersDataTableFilter[]Definition of available filters.
idstringElement identifier; associates labels and descriptions.
multiSelectbooleanAllow multiple row selection.
onChangeChangeEventHandler<HTMLTableElement, Element>Change event. Check the type: some controls return an object, others a DOM event.
onClickMouseEventHandler<HTMLTableElement>Action performed when the element is activated.
onFilterMenuOpenChange((open: boolean) => void)Callback for this event. The signature describes its arguments.
onSubmitSubmitEventHandler<HTMLTableElement>Form submission event.
pageSizenumberNumber of rows per page.
pageSizeOptionsnumber[]Available page sizes.
paginatedbooleanEnable pagination.
paginationVariant"buttons" | "numbers"Configures paginationVariant. The type describes the supported values and structure.
renderRowActions((row: TData) => ReactNode)Configures renderRowActions. The type describes the supported values and structure.
roleAriaRoleSemantic role of the element. Keep the default role unless a change is justified.
rowActionsDataTableAction<TData>[]Configures rowActions. The type describes the supported values and structure.
searchablebooleanEnable built-in search.
searchPlaceholderstringSearch hint text.
selectablebooleanAllow row selection.
styleCSSPropertiesReact inline styles.
tabIndexnumberKeyboard focus order and availability.
titlestringTitle or supplementary information.

TypeScript definition

Review each component's properties and published declaration. Native and accessibility attributes are inherited from the element specified by its type.

DataTable32 properties
DataTable · TypeScript
1declare function DataTable<TData extends RowData>({ advanced, columns, data, emptyMessage, filterable, filters, filterMenuOpen, className, multiSelect, onFilterMenuOpenChange, pageSize, pageSizeOptions, paginated, paginationVariant, renderRowActions, rowActions, bulkActions, searchable, searchPlaceholder, selectable, ...props }: DataTableProps<TData>): React.JSX.Element;
API generated from @kivora/nextjs 0.2.0View package