Complete reference for every prop, type, and export in react-data-table-component v8.
Looking for examples or recipes? This page is the flat reference for "what does prop X do?". Each feature has its own page with examples. Start there if you're new:
DataTable<T> accepts the following props where T is the row data type. Only columns and data are required.
Data
Prop
Type
Default
Description
data
T[]
-
Required. Array of row objects.
columns
TableColumn<T>[]
-
Required. Column definitions.
keyField
string
"id"
Property on each row used as a stable React key.
progressPending
boolean
false
Show a loading state. On initial load (no data yet) renders shimmer skeleton rows. On re-fetch (data already loaded) dims the existing rows and overlays a centered spinner. The column header always stays visible.
progressComponent
ReactNode
built-in spinner
Custom loading indicator shown in the re-fetch overlay, and on initial load when progressSkeleton is false.
progressSkeleton
boolean
true
Show shimmer skeleton rows on the initial load (no data yet). Set to false to show progressComponent on initial load instead.
noDataComponent
ReactNode
built-in message
Rendered when data is empty.
Layout & appearance
Prop
Type
Default
Description
title
string | ReactNode
-
Table title shown in the header bar.
actions
ReactNode | ReactNode[]
-
Content rendered on the right side of the header bar.
subHeader
ReactNode
-
Content for the sub-header bar. Providing any value shows the bar.
subHeaderAlign
Alignment
"right"
Alignment of sub-header content.
subHeaderWrap
boolean
true
Allow sub-header to wrap onto multiple lines.
noHeader
boolean
false
Force-hide the title/actions header bar. The bar otherwise renders only when a title or actions is provided, so you rarely need this.
noTableHead
boolean
false
Hide the column header row.
persistTableHead
boolean
false
Show the column header even when data is empty. The header always stays visible during progressPending regardless of this prop.
dense
boolean
false
Reduce row height for a compact look.
responsive
boolean
true
Wrap the table in a horizontally scrollable container. Disable only when a parent element owns scrolling, see Turning the scroll container off.
fixedHeader
boolean
false
Stick the column header at the top when scrolling.
fixedHeaderScrollHeight
string
"100vh"
Max height of the scrollable body when fixedHeader is on.
onScroll
(event) => void
-
Called when the user scrolls the table body. Works with both fixedHeader enabled and disabled.
direction
Direction
Direction.AUTO
Text direction (ltr, rtl, auto).
className
string
-
Extra CSS class on the root element.
style
CSSProperties
-
Inline styles on the root element.
ariaLabel
string
-
Value for the table's aria-label.
disabled
boolean
false
Disable all interactive controls.
Theming & styling
Prop
Type
Default
Description
theme
ThemeProp
"default"
Named built-in theme, a Theme object from createTheme(), or a raw CSS-variable map.
colorMode
ColorMode
"system"
Controls when the theme's dark-mode overrides apply. "system" follows localStorage, the html.dark class, then prefers-color-scheme. "light" / "dark" force a mode.
Called whenever the sort changes. sortColumns is the full sort config in priority order; an empty array means the sort was cleared.
column.sortable
boolean
false
Enable sorting on this column.
column.sortFunction
(a, b) => number
-
Per-column sort comparator. Takes priority over the table-level sortFunction.
column.sortField
string
-
Backend field name passed to onSort when it differs from column.id.
ref.clearSort()
DataTableHandle
-
Imperatively reset sort to the default state. See DataTableHandle.
Pagination
Prop
Type
Default
Description
pagination
boolean
false
Enable built-in pagination controls.
paginationPerPage
number
10
Rows shown per page.
paginationPosition
'top' | 'bottom' | 'both'
'bottom'
Where the pagination bar renders. 'both' shows it above and below the table simultaneously.
paginationRowsPerPageOptions
number[]
[10,15,20,25,30]
Options in the rows-per-page dropdown.
paginationDefaultPage
number
1
Initial active page.
paginationPage
number
-
Controlled active page. When provided, the table navigates to this page whenever the value changes. Use together with onChangePage to keep them in sync.
paginationResetDefaultPage
boolean
false
Toggle to reset to page 1 (e.g. after a filter change). Prefer paginationPage for new code.
paginationTotalRows
number
-
Total row count for server-side pagination.
paginationServer
boolean
false
Delegate page changes to onChangePage / onChangeRowsPerPage.
paginationServerOptions
PaginationServerOptions
-
Selection-persistence options for server-side mode.
paginationComponentOptions
PaginationOptions
-
Localisation and display options for the built-in paginator.
paginationComponent
React.ComponentType
-
Replace the built-in pagination UI entirely.
paginationIcons
PaginationIcons
-
Override any or all pagination icons. Pass a partial object: { next: <MyIcon /> }.
onChangePage
(page, totalRows) => void
-
Called when the active page changes.
onChangeRowsPerPage
(rowsPerPage, page) => void
-
Called when rows-per-page selection changes.
Footer
Prop
Type
Default
Description
footerComponent
ComponentType<FooterComponentProps<T>>
-
Replace the footer row with a custom component. Receives { rows, columns }. Takes precedence over column-level footer fields.
showFooter
boolean
-
Force the footer row on or off. By default the footer renders when footerComponent is set or any visible column declares a footer. Set to false to suppress, true to render an empty footer row.
Column-level footers live on each TableColumn<T> as thefooter field. See Footer for the full walkthrough.
Row selection
Prop / method
Type
Default
Description
selectableRows
boolean
false
Show a checkbox column for row selection.
selectableRowsSingle
boolean
false
Allow only one row to be selected at a time.
selectableRowsNoSelectAll
boolean
false
Hide the "select all" checkbox in the header.
selectableRowsVisibleOnly
boolean
false
"Select all" only selects rows on the current page.
selectableRowsHighlight
boolean
false
Highlight selected rows using the theme's selected color.
selectableRowsRange
boolean
true
Enable Shift-click range selection. Disabled automatically in single-select mode.
selectableRowDisabled
(row: T) => boolean
-
Disable selection for a specific row.
selectableRowSelected
(row: T) => boolean
-
Pre-select rows that satisfy the predicate.
selectedRows
T[]
-
Controlled selection. When supplied, drives selection state from the outside; matched against keyField.
selectableRowsComponent
"input" | ReactNode
built-in checkbox
Custom checkbox component.
selectableRowsComponentProps
object
-
Extra props forwarded to the custom checkbox component. Function values are called with the checkbox's indeterminate state and their return value is passed instead.
onSelectedRowsChange
(state) => void
-
Called whenever selection changes. Receives { allSelected, selectedCount, selectedRows }.
clearSelectedRows
boolean
-
Deprecated. Toggle to clear selection. Use ref.current.clearSelectedRows() instead.
ref.clearSelectedRows()
DataTableHandle
-
Imperatively deselect all selected rows. See DataTableHandle.
Expandable rows
Prop
Type
Default
Description
expandableRows
boolean
false
Enable the expandable row feature.
expandableRowsComponent
React.ComponentType
-
Component rendered in the expanded panel. Receives { data: T }.
expandableRowsComponentProps
object
-
Extra props merged into expandableRowsComponent.
expandableRowExpanded
(row: T) => boolean
-
Control which rows start expanded.
expandableRowDisabled
(row: T) => boolean
-
Prevent specific rows from being expanded.
expandableRowsHideExpander
boolean
false
Hide the expander chevron column (use with expandOnRowClicked).
expandOnRowClicked
boolean
false
Toggle expansion by clicking anywhere on the row.
expandOnRowDoubleClicked
boolean
false
Toggle expansion by double-clicking anywhere on the row.
expandableInheritConditionalStyles
boolean
false
Apply the parent row's conditional styles to the expanded panel.
expandableIcon
{ collapsed, expanded }
built-in chevron
Custom expand/collapse icons.
onRowExpandToggled
(expanded, row) => void
-
Called when a row is expanded or collapsed.
Row events
Prop
Type
Description
onRowClicked
(row, event) => void
Called when a row is left-clicked.
onRowDoubleClicked
(row, event) => void
Called when a row is double-clicked.
onRowMiddleClicked
(row, event) => void
Called when a row is middle-clicked (scroll-click). Use with onRowClicked to implement open-in-new-tab behaviour.
onRowMouseEnter
(row, event) => void
Called when the pointer enters a row.
onRowMouseLeave
(row, event) => void
Called when the pointer leaves a row.
Keyboard navigation
Prop
Type
Default
Description
cellNavigation
boolean
false
Spreadsheet-style keyboard navigation using the WAI-ARIA grid pattern (role="grid", single Tab stop, roving tabindex). Arrow keys move between cells, including header, selection, and expander cells; Home/End and Ctrl+Home/Ctrl+End jump to row and grid edges; Enter/F2 open a cell editor; Enter/Space sort from a header. See Keyboard navigation.
Column features
Prop
Type
Default
Description
resizable
boolean
false
Show drag handles on column headers for resizing.
columnGroups
ColumnGroup[]
-
Spanning group headers rendered above the column header row.
filterValues
Record<string | number, FilterState>
-
Controlled filter state. Omit to use internal state. See Filtering.
onFilterChange
(columnId, filter: FilterState) => void
-
Called when the user clicks Apply or Clear in a filter popup.
onColumnOrderChange
(columns: TableColumn<T>[]) => void
-
Called after a drag-to-reorder column operation with the new column order.
Called after a group drag-reorder with the new group order and the matching updated column order.
column.pinned
'left' | 'right'
-
Freeze the column to an edge during horizontal scroll. Only visible when the table overflows its container — give columns explicit widths. See Column pinning.
Enable the context menu. true enables header and row menus with the right-click trigger. The header menu has built-in sort/pin/hide/reset actions; the row menu only opens when contextMenuActions.row returns items. menuPosition sets which inline edge the row menu button sits on (default 'end' — right in LTR). See Context menu.
Called for every selected item, built-ins included (after their effect is applied). ctx is { type: 'header', column } or { type: 'row', row, rowIndex }.
Localization
Prop
Type
Default
Description
localization
Localization
-
Override every user-visible string and aria-label in the table. Pass a pre-built locale or build your own. See Localization.
columnFilterOptions
ColumnFilterOptions
-
Deprecated. Use localization={{ filter: { ... } }} instead. Will be removed in v9.
expandableRowsOptions
ExpandableRowsOptions
-
Deprecated. Use localization={{ expandable: { ... } }} instead. Will be removed in v9.
ColumnGroup
Defines a spanning group header above one or more columns. Pass an array to thecolumnGroups prop.
Stable identity used by defaultSortFieldId, columnGroups, and filterValues.
name
ReactNode
Column header label.
selector
(row, index?) => Primitive | ReactNode
Data accessor. For sortable columns return a Primitive (string | number | boolean | bigint | Date). Rows whose selector returns null or undefined sort to the end. bigint displays as its decimal string; Date displays via toLocaleString(), which follows the viewer's locale and timezone. Use format when you need deterministic or SSR-stable output.
cell
(row, index, column, id) => ReactNode
Custom cell renderer. Overrides the selector display value.
format
(row, index) => ReactNode
Format the selector value for display without changing the sort key.
sortable
boolean
Enable sorting on this column.
sortFunction
(a: T, b: T) => number
Custom comparator for this column.
sortField
string
Field key passed to onSort for server-side sort identification.
filterable
boolean
Show a filter popup for this column.
filterType
"text" | "number" | "date"
Filter operator set and input widget. Defaults to "text". See Filtering.
filterFunction
(row, filter: FilterState) => boolean
Custom filter predicate. Overrides built-in operator logic. Receives the full FilterState including both conditions.
width
string
Fixed column width, e.g. "120px".
minWidth
string
Minimum width.
maxWidth
string
Maximum width.
grow
number
Flex-grow factor (default 1). Set to 0 to prevent growing.
right
boolean
Right-align cell content.
center
boolean
Center cell content.
wrap
boolean
Allow cell text to wrap.
compact
boolean
Remove cell padding.
button
boolean
Center content and suppress row click propagation.
allowOverflow
boolean
Allow cell content to overflow (useful for dropdowns and popovers).
ignoreRowClick
boolean
Prevent clicks in this cell from firing onRowClicked.
hide
Media
Hide the column below the given breakpoint (Media.SM = 599px, MD = 959px, LG = 1280px).
omit
boolean
Exclude the column entirely. Toggle this to show/hide a column.
reorder
boolean
Allow drag-to-reorder for this column (requires reorder on at least two columns).
pinned
'left' | 'right'
Freeze the column to an edge during horizontal scroll. Only visible when the table overflows its container — give columns explicit widths. See Column pinning.
style
CSSProperties
Inline styles applied to every cell in this column.
conditionalCellStyles
ConditionalStyles<T>[]
Per-cell conditional styles.
footer
ReactNode | (rows: T[]) => ReactNode
Footer cell for this column. Static node or a function receiving the filtered+sorted rows (typically used to render aggregates like sums or averages). When any visible column has a footer, a footer row renders below the body. See Footer.
Inline editing
Prop
Type
Description
editable
boolean
Shorthand for editor: { type: 'text' }. Ignored when editor is also set.
editor
CellEditor
Editor configuration. See CellEditor below. Takes precedence over editable.
validate
(value, row, column) => true | false | string
Gate the edit before onCellEdit fires. Return true to accept, false to reject silently, or a string error to keep the editor open with an inline tooltip.
onCellEdit
CellEditCallback<T>
Called when the user commits an edit. Receives (row: T, value: string, column: TableColumn<T>). The value is always a string; parse it to the target type in your handler.
See Inline editing for examples, CSS variables, and styling guidance.
Identifier passed to onContextMenuAction. The built-in header actions reserve sort-asc, sort-desc, clear-sort, pin-left, pin-right, unpin, hide-column, and reset.
label
ReactNode
Item content.
disabled
boolean
Render the item disabled.
icon
ReactNode
Optional icon rendered before the label.
Related types: ContextMenuConfig (the object form of the contextMenu prop),ContextMenuActions<T> (the contextMenuActions prop shape), andContextMenuActionContext<T> (the ctx argument of onContextMenuAction) are all exported. See Context menu.
DataTableHandle (ref)
Attach a ref to DataTable to imperatively control it.
Reset sort to the default (defaultSortFieldId / defaultSortAsc), or unsorted if no defaults are set.
TableStyles
Pass to customStyles to override styles for any part of DataTable. Each key accepts a style object (React.CSSProperties) and optional extra properties.