DataTable

View Source

Organize any type of data into rows and columns.

Collapsible subrows

HEADER
SIDEBAR
First Name
Last Name
Age
Address
Email
Other
Isabella
Hand
57533
Dorian Turnpike Pouros Divide, North Lillian 50651
Lupe72@gmail.com
Kozey - Franecki (Ergonomic human-resource frame)
Ara
Gibson
52854
Daniel Run Armstrong Locks, Durganshire 09934-6858
Bailey_Mraz@gmail.com
Casper, Wilderman and Jakubowski (Operative motivating infrastructure)
Reid
Dicki
14665
Bogan Parks Dariana Isle, New Tanya 05752-9971
Gerda54@gmail.com
Smith - Hegmann (Secured analyzing migration)
Benjamin
Bode
34440
Bechtelar Corner Tyrique Wells, Port Sheldonshire 36850
Joe.Conn@yahoo.com
Ruecker - Brown (Future-proofed homogeneous complexity)
Brandi
Bednar
37156
Schaefer Shoals Alison Curve, New Carmelo 03351-3915
Oswaldo.Bergnaum65@gmail.com
Hills - Skiles (Decentralized non-volatile attitude)
Uriel
Terry
94931
Bernadine Common Haley Isle, Lake Jayneside 64928
Myrtie78@yahoo.com
Hermiston, Konopelski and Rath (Function-based empowering leverage)
Colby
Bechtelar
37376
Sharon Pike Jalyn Turnpike, Lake Hassan 65440
Edgar_Buckridge@hotmail.com
Murray, Nikolaus and Welch (Progressive cohesive model)
Lura
Cormier
97441
Dooley Green Claud Common, Lake Oscar 54080-3233
Hector.Towne@yahoo.com
Emard, Schaefer and Thompson (Configurable zero administration approach)
Freida
Hackett
8218
Auer Curve Krajcik Unions, Marianoburgh 21209
Alphonso_Jaskolski12@yahoo.com
Shields, Hilll and Heathcote (Down-sized analyzing solution)
Anne
Stark
89328
Rempel Locks Strosin Divide, New Odessa 47090-1481
Abdiel_Weber@hotmail.com
Gorczany Group (Polarised object-oriented standardization)

Sortable rows

10 Results

Full Name
First Name
Last Name
Company

Amara Champlin

Amara
Champlin

Runte - Wiza

99772

Leopoldo Lakin

Leopoldo
Lakin

Haley - Stamm

9988

Valerie Emmerich

Valerie
Emmerich

Walter and Sons

50313

Jesse Lemke

Jesse
Lemke

Herman Inc

77207

Lucious Effertz

Lucious
Effertz

Heathcote LLC

91404

Jasmin Cassin

Jasmin
Cassin

Runte - Walsh

28195

D'angelo Ward

D'angelo
Ward

Ondricka - Heidenreich

14640

Dayana Mraz

Dayana
Mraz

O'Keefe, Parker and Price

72731

Jedidiah Abshire

Jedidiah
Abshire

Anderson, Jones and Wolf

66117

Hiram Hackett

Hiram
Hackett

Kautzer - Hirthe

4162

Multiple drag and drop tables

Name
Age
Darian Spinka
36171
Lavonne Marquardt
58388
Hermann Wyman
4287
Name
Age
Theodora Kling
80432
Pedro Kling
60311
Collin Towne
7032
Aubree Dietrich
67663
Sam Miller
65470

Grouped data

Name
Position
Start Date

Steuber - Boyle

Cheyanne Goodwin
National Directives Developer
08/25/2025
Sasha Lubowitz
Human Data Strategist
06/26/2025

Ortiz - Deckow

Earnestine Oberbrunner
Global Configuration Agent
03/25/2026
Chanelle Toy
Dynamic Group Agent
09/28/2025
Annabel Lebsack
Direct Branding Executive
10/20/2025
Angelina Kuhic
Lead Applications Supervisor
12/28/2025
Georgette Bogan
Central Integration Designer
03/19/2026
Hailey Kunde
Lead Intranet Assistant
08/24/2025

Bergstrom Inc

Lizeth Zboncak
Principal Creative Coordinator
05/27/2026
Max Langworth
International Metrics Architect
04/19/2026
Jonatan Davis
Direct Creative Technician
03/19/2026

Props

accessibilitysignature
toggleAllSubRowsTooltipTitle:Function

Provides the ability to change accessible labels used throughout the DataTable component.

Controls whether or not sub-rows can be collapsed.

columnsArray
alwaysVisible:boolean

Forces the column to always be visible regardless of hiddenColumnIds. This is also used to build a list of eligible columns for the ColumnPicker component.

cell:string | unknown

Controls how the incoming row data is rendered in a cell. Accepts a string that will be used as an accessor of the row data or a function that returns the row data as well as extra information about the row and column.

css:any
defaultSortDirection:'ASC' | 'DESC'

Overrides defaultSort.direction for this specific column. Defaults to ASC if neither values are provided.

footer:any

Similar to column.header. Controls the column footer rendering.

header:any

Controls the column header rendering. Accepts a string, element, component or function.

id:string | number

Used to identify a column. Required when using onRowSort or hiddenColumnIds.

includeSubCellWidth:boolean

Includes sub cells when calculating auto column widths.

label:string

Used to describe a column in ColumnPicker when header doesn't display any text like checkbox or icon.

maxWidth:number

The maximum size a column can be.

minWidth:number

The minimum size a column must be.

sortable:boolean

Determines if a column can be sorted or not. Defaults to false. See onColumnSort below for details on controlling sorting.

subCell:string | Function

Determines how a sub row cell is rendered. Uses cell as the default accessor if nothing is provided.

width:number

Specifies how wide a column is. If omitted, cell will be measured and calculated based on the largest column's cell width.

Determines how the incoming data is rendered as columns. Please note for optimal performance identity should not change between every render and should be static or memoized.

Current visible page number for pagination

dataArray

Accepts an array of data to be rendered. Data cells are ordered by the columns array.

Ref that is passed to useImperativeHandle which in turn returns `useCollapsibleRows.

Controls whether or not sub-rows are open by default.

defaultSortsignature
columnId:string | number
direction:'ASC' | 'DESC'

Default sorting for columns. Please note this only affects controls and requires you to manage sorting the data yourself. See onColumnSort below for details on controlling sorting.

Droppable identifier used for internal DragDrop component.

Provide an empty state when the table has no data.

getRowId(rowData: Data, rowIndex: number) => number | string

(rowData: object, rowIndex: number) => number

Used to identify rows. Defaults to rowData.id if available, otherwise uses rowIndex.

getSubDataFunction

(rowData: object) => array<object>

Controls rendering of collapsible sub row content.

Hide specific columns by their id.

innerBodyRefFunction

(bodyRef: object) => void

Used to gain access to the internal bodyRef.

Accepts an object of keyboard shortcuts that can be performed when hovering a row. e.g. { 'a': ({ rowData }) => addUser(rowData.id) }. See the mousetrap library for valid key combinations.

loadingboolean

Puts the table in a loading state and shows a spinner in the middle of the table.

Provide an accompanying title to the spinner while loading data.

onColumnSortFunction

(sortedColumns: { columnId, direction }) => void

Callback when a column header has been pressed.

onDragEndFunction

onDragEnd: (event) => void

Called at the end of a child Draggable drag.

onDragStartFunction

onDragStart: (event) => void

Called at the start of a child Draggable drag.

onDropFunction

onDrop: (event) => void

This function will be called when a Draggable has been dropped. Returns the onDragEnd event with any Draggable data attached.

onPageChangeComponentProps['onPageChange']

(nextPage: number) => undefined

Callback when new page is requested for pagination.

onRowClickFunction

(rowData: any, rowIndex: number, event: React.SyntheticEvent) => void

Callback when a row has been clicked.

onRowSortFunction

(sortedData: array) => void

Callback when a row has been sorted.

sourceOnlyboolean

This prop controls whether or not the droppable can receive and reorder draggables. If true, draggables may move outside the droppable, but not added.

Total available pages for pagination.

variantsignature | Array
body:Object
bodyCell:Object | Function

({ firstRow, lastRow, firstCell, lastCell, rowData, rowIndex, columnIndex }) => object

bodyRow:Object | Function

({ isLink, firstRow, lastRow, evenRow, oddRow, rowData, rowIndex }) => object

bodySubCell:Object | Function

({ firstRow, lastRow, firstCell, lastCell, rowData, rowIndex, columnIndex, columnWidth }) => object

bodySubRow:Object | Function

({ isLink, firstRow, lastRow, evenRow, oddRow, rowData, rowIndex, parentRowIndex }) => object

header:Object
headerCell:Object | Function

({ columnIndex, isSortable }) => object

headerRow:Object

Provides the ability to change styles used throughout the DataTable component.