DataTable

View Source

Organize any type of data into rows and columns.

Collapsible subrows

HEADER
SIDEBAR
First Name
Last Name
Age
Address
Email
Other
Chadrick
Torp
72569
Torey Shores Hackett Grove, New Celinetown 18139
Lorenzo57@gmail.com
McGlynn - Walsh (Reactive mission-critical policy)
May
Lowe
88223
Donald Highway Schulist Trafficway, North Jamarcuston 84042
Juanita49@gmail.com
Bednar LLC (Intuitive bifurcated emulation)
Anabelle
Paucek
72947
Jeanie Drive Millie Fords, East Alyce 00571-9113
Barrett_Feest@yahoo.com
Sauer - Bauch (Managed analyzing installation)
Stacey
Yost
92960
Veum Wells Rita Vista, Howellstad 59924-6427
Jerel.Lang@yahoo.com
Williamson Group (Down-sized homogeneous extranet)
Verlie
Herman
3092
Marjory Pine Mills Mountains, West Gretchen 59277
Roxane_Reilly83@hotmail.com
Reichert, Stehr and Bednar (Total client-driven contingency)
Phyllis
Gaylord
92209
Kling Trace Lonie Grove, Rayberg 25135
Kaya_Grant@yahoo.com
Koepp and Sons (Down-sized attitude-oriented implementation)
Evangeline
Walker
87290
Champlin Plaza Herzog Shores, East Cruz 37778
Annabell.Rice1@gmail.com
Collier, Labadie and Bernier (Multi-channelled background architecture)
Sierra
MacGyver
40242
Casper Field Spinka Haven, East Hoyt 38826-0566
Bertha_Torphy@gmail.com
Kozey LLC (Extended motivating frame)
Adaline
Lakin
38727
Moen Parkway Herman Vista, North Jackeline 44685-7085
Salvador_Breitenberg@gmail.com
Kuphal - Gaylord (Open-architected asynchronous internet solution)
Monserrat
Wehner
68584
Heaney Stravenue Schulist Brooks, Larkinberg 39345-9857
Velda.Hessel@yahoo.com
Mayer - Herman (Synergized exuding success)

Sortable rows

10 Results

Full Name
First Name
Last Name
Company

Madisyn Torp

Madisyn
Torp

Lind, Reichel and Orn

39355

Monroe Senger

Monroe
Senger

Bergstrom, Ullrich and Boehm

99570

Dexter Feil

Dexter
Feil

Mayer - Torphy

54287

Muhammad Wehner

Muhammad
Wehner

Kuphal - Balistreri

53077

Felipe Douglas

Felipe
Douglas

Casper - Balistreri

99452

Davin Pacocha

Davin
Pacocha

Hansen - Beahan

26416

Raphaelle Thiel

Raphaelle
Thiel

Walker - Beer

851

Ezekiel Robel

Ezekiel
Robel

Rau - Will

14011

Mitchel Pfannerstill

Mitchel
Pfannerstill

Leuschke - Wisozk

40045

Yoshiko Swaniawski

Yoshiko
Swaniawski

Abshire - Christiansen

57126

Multiple drag and drop tables

Name
Age
Ellsworth Batz
34545
Austyn Cummings
65801
Werner Mosciski
33122
Name
Age
Wilfredo Langworth
94225
Juwan Orn
80585
Demetrius Boehm
76395
Jamison Breitenberg
31225
Jacey Lowe
20777

Grouped data

Name
Position
Start Date

Koelpin - Rolfson

Alysson Champlin
Forward Quality Liaison
01/09/2025
Ole Turcotte
Principal Tactics Liaison
10/07/2024
Rafaela Jacobi
Dynamic Implementation Planner
01/18/2025
Tobin Nitzsche
Investor Implementation Designer
06/27/2024

Larson, Romaguera and Torp

Rhoda Rosenbaum
Human Accountability Specialist
01/25/2025
Grayce O'Conner
Direct Group Associate
04/14/2024
Gregoria Ruecker
National Implementation Planner
07/24/2024
Raheem Hodkiewicz
Lead Program Liaison
10/15/2024

Fisher, Bosco and Yundt

Alfreda Lesch
Forward Implementation Agent
04/04/2024
Henderson Koelpin
Legacy Configuration Architect
12/27/2024
Shyanne Corkery
Corporate Implementation Engineer
07/21/2024
Teagan Mueller
District Creative Manager
06/15/2024
Abbigail Lueilwitz
Forward Quality Administrator
06/15/2024
Ellen Goldner
Lead Brand Coordinator
09/15/2024

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.