v14.2.0

Playroom

Github

DataTable

View Source

Organize any type of data into rows and columns.

Collapsible subrows

Filter
HEADER
SIDEBAR
First Name
Last Name
Age
Address
Email
Other
Pansy
Renner
41821
Koelpin Club Modesta Ports, East Ameliehaven 57299
Jody.Morissette40@gmail.com
Konopelski Inc (Public-key 24/7 firmware)
Charlene
Prosacco
71006
Antonette Flat Ernesto Lake, Sophieside 18322-6719
Kailyn_Will93@gmail.com
Kuhn - Weimann (Persevering responsive model)
Kyla
Robel
76641
Thomas Viaduct Stephen Lodge, Columbustown 14586
Miller_Rath@yahoo.com
Grimes Group (Right-sized interactive success)
Devonte
Hane
36760
Kiel Neck Gaylord Heights, Nicolasside 26410-3516
Tobin_Rodriguez60@yahoo.com
Homenick Inc (User-centric bi-directional hub)
Conor
Herzog
79357
Kristina Haven Zemlak Hill, Ernieview 88429-2274
Eveline28@yahoo.com
Hauck, Lesch and Lowe (Profit-focused explicit secured line)
Zion
Wolff
1252
Eveline Port Walter Springs, Elisetown 23274
Laury_Abbott1@yahoo.com
Runolfsson Inc (Front-line contextually-based extranet)
Ena
Larson
9226
Al Light Considine Bridge, Ratkefurt 27396
Alba63@yahoo.com
Lebsack, Hickle and Swaniawski (Exclusive heuristic portal)
Grayce
Witting
224
Lehner Freeway Bradley Views, Port Ida 76436-5550
Alexys_Jacobs48@hotmail.com
Rosenbaum Group (Reduced multimedia function)
Julianne
Barton
36042
Leta Plain Koch Branch, Hartmannhaven 19956-1214
Ellen15@gmail.com
Mertz Group (Cross-platform uniform application)
Alana
Littel
88672
Gonzalo Plains Junior Coves, Kubshire 68501-5333
Rachael_Morar94@hotmail.com
Klein, Yundt and Franecki (Quality-focused cohesive approach)
Copy
Edit

Sortable rows

10 Results

Reload Data
Clear data
Condensed
Full Name
First Name
Last Name
Company

Carlo McCullough

Carlo
McCullough

Huels Group

42060

Cesar Hyatt

Cesar
Hyatt

O'Connell - Wiza

59150

Kieran Kerluke

Kieran
Kerluke

MacGyver Inc

89036

Trey Bode

Trey
Bode

Schmitt, Leannon and Erdman

5831

Nia Reichert

Nia
Reichert

Heathcote, Grant and Quitzon

20375

Jayda Kessler

Jayda
Kessler

Welch - Rau

76546

Garett Johnson

Garett
Johnson

Harris - VonRueden

8119

Devin Graham

Devin
Graham

Jacobi LLC

80296

Ottis Kiehn

Ottis
Kiehn

Hirthe Inc

24745

Candido Dietrich

Candido
Dietrich

Stiedemann and Sons

16710
Copy
Edit

Multiple drag and drop tables

Name
Age
Ona Rodriguez
50477
Geovanni Muller
25962
Maiya Padberg
12755
Name
Age
Lilyan Marks
25226
Joany Mante
42058
Kyla Paucek
12261
Hilbert Leannon
42673
Celestine Crist
98139
Copy
Edit

Grouped data

Name
Position
Start Date

Abernathy, Kreiger and Trantow

Dane Abernathy
Legacy Metrics Orchestrator
05/24/2020
Tate Rolfson
Investor Applications Associate
08/23/2020

Schneider - Stokes

Manuela Towne
Senior Mobility Supervisor
01/12/2021

Batz and Sons

Sanford Waters
District Operations Strategist
09/16/2020
Stacy Rowe
Corporate Security Executive
06/18/2020
Copy
Edit

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 | Function

(row: object<mixed>, data: array<object>) => void

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.

header:any

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

footer:any

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

id:string | number

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

label:string

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

sortable:boolean

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

defaultSortDirection:'ASC' | 'DESC'

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

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.

minWidth:number

The minimum size a column must be.

maxWidth:number

The maximum size a column can be.

includeSubCellWidth:boolean

Includes sub cells when calculating auto column widths.

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.

dataArray

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

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.

getRowIdFunction

(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.

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.

onRowClickFunction

(rowData: any, rowIndex: number) => void

Callback when a row has been clicked.

onRowSortFunction

(sortedData: array) => void

Callback when a row has been sorted.

variantsignature | Array
header:Object
headerRow:Object
headerCell:Object | Function

({ columnIndex, isSortable }) => object

body:Object
bodyRow:Object | Function

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

bodyCell:Object | Function

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

bodySubRow:Object | Function

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

bodySubCell:Object | Function

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

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

  • Collapsible subrows
  • Sortable rows
  • Multiple drag and drop tables
  • Grouped data
  • Props
PreviousCollapseNextDivider