DataTable

View Source

Organize any type of data into rows and columns.

Collapsible subrows

HEADER
SIDEBAR
First Name
Last Name
Age
Address
Email
Other
David
Tremblay
92550
Leffler Camp Savannah Squares, New Tracemouth 91043
Wiley_King@hotmail.com
Blanda Group (Diverse zero defect contingency)
Coleman
Gislason
10605
Tiana Forest Keagan Valleys, Sierrachester 19898-1735
Asia_Howe@hotmail.com
Dietrich, Toy and Nolan (Open-source maximized complexity)
Penelope
Bergstrom
92319
Jenkins Rue Verner Drive, West Haley 79804
Brayan.Yost30@yahoo.com
Leffler LLC (Versatile tangible productivity)
Lexus
Cartwright
25037
Terry Lane Champlin Drive, Davionmouth 04256-5305
Carol.OHara@hotmail.com
Nitzsche, Kerluke and Walsh (Extended system-worthy application)
Titus
Howell
80079
Elsie Village Balistreri Skyway, West Candida 33783
Hosea83@gmail.com
Kertzmann, Ledner and Skiles (Cloned discrete firmware)
Agnes
Tromp
92827
Adams Ridge Ashtyn Court, Justenmouth 50750
Destini.Gutkowski@hotmail.com
Harris and Sons (Networked 4th generation superstructure)
Ilene
Mills
29136
Crystal Track Matt Spurs, Considineport 49544
Janet66@yahoo.com
Hermann - Hauck (Open-architected tangible project)
Lou
Kuvalis
87465
Antonina Greens Dandre Ridges, West Demetris 56931-6503
Julius22@hotmail.com
Fahey - Weissnat (Monitored transitional utilisation)
Erica
Koch
28313
Ubaldo Burg Keebler Flats, East Alessiahaven 82555-4607
Jarvis.OConner@hotmail.com
Trantow, Reynolds and Toy (Open-source solution-oriented help-desk)
Gregoria
Kohler
41439
Elyssa Gardens Gabrielle Avenue, Wilkinsonmouth 44995
Mitchel_Stark61@hotmail.com
Schmitt - Krajcik (Proactive grid-enabled success)

Sortable rows

10 Results

Full Name
First Name
Last Name
Company

Michel Schmeler

Michel
Schmeler

Mitchell - Heathcote

37060

Raquel Will

Raquel
Will

Price Group

98193

Tanner Osinski

Tanner
Osinski

Hartmann - Wolff

26477

Rogelio Bauch

Rogelio
Bauch

Wisozk - Johnston

45443

Heather Pfannerstill

Heather
Pfannerstill

D'Amore, Wiza and Ryan

81671

Federico McLaughlin

Federico
McLaughlin

Stokes - Dietrich

11745

Kirk Wilkinson

Kirk
Wilkinson

Ledner Group

23722

Burdette Erdman

Burdette
Erdman

Ziemann, Corkery and Runolfsson

63

Faustino Trantow

Faustino
Trantow

Herzog, Braun and Moore

66069

Dewitt Spencer

Dewitt
Spencer

Gleason, Goyette and Kshlerin

7304

Multiple drag and drop tables

Name
Age
Nelson Goldner
18935
Ulises Hermann
75542
Lucie Green
4753
Name
Age
Thurman Kautzer
72734
Evelyn Cassin
91408
Mariam Walsh
41231
Maude Jacobs
77994
Isabella Lynch
51137

Grouped data

Name
Position
Start Date

Upton, Erdman and Becker

Bryce Zulauf
Central Identity Assistant
08/16/2025
Newton Bruen
Chief Markets Strategist
10/10/2025
Rene Windler
Chief Factors Coordinator
08/11/2025

Veum - Steuber

Michele Hudson
Dynamic Assurance Facilitator
12/11/2024

Boehm, Bruen and Gusikowski

Nestor Lynch
Global Group Architect
05/12/2025
Cassie Borer
Investor Integration Liaison
01/07/2025

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.