.finally(React)

English
Copyright © 2023-currentdotfinally, LLC

Table

(╯°□°)╯︵ ┻━┻

The Table component can be used by importing { Table } from "finallyreact".

Example

NameAge
Marceline Abadeer1000
Princess Bubblegum1000
Flame Princess21
Example

Custom Renders

Name
Age
Marceline Abadeer
Age
Princess Bubblegum1000
21
Custom Renders

Custom Styles

NameAge
Marceline Abadeer1000
Princess Bubblegum1000
Flame Princess21
Custom Styles

Column Sort

Set column.enableSort to true for each column that's sortable and use the onSort prop to write sorting logic for your data

NameAge
Marceline Abadeer1000
Princess Bubblegum1000
Flame Princess21
Column Sort

Customize Sort

Use customSortIconAsc and customSortIconDesc for custom icons or sortIconProps for custom props values

NameAgeHobby
Marceline Abadeer1000guitar
Princess Bubblegum1000science
Flame Princess21rapping
Customize Sort

Pagination

IDNameFavorite ColorFavorite FoodHobby
1Aikobluetofureading
2Chiekogreentempehprogramming
3Emikoyellowvegan croissantcrocheting
4Fumikopinkvegan ice creamknitting
5Harukopurplevegan chocolatedrawing
6Hirokoindigovegan cakegaming
7Junkolavendervegan pizzaanime
8Kazukosakuranachosmanga
9Miekobluevegan ramensinging
10Mitsukogreenhummus sandwichreading
1
2
3
4
5
17
10
Rows
Pagination

Disabled

IDNameFavorite ColorFavorite FoodHobby
1Aikobluetofureading
2Chiekogreentempehprogramming
3Emikoyellowvegan croissantcrocheting
4Fumikopinkvegan ice creamknitting
5Harukopurplevegan chocolatedrawing
1
2
3
4
5
33
5
Rows
Disabled

Simple

NameAge
Marceline Abadeer1000
Princess Bubblegum1000
Flame Princess21
Simple

Mobile View

Name
Marceline Abadeer
Age
1000
Name
Princess Bubblegum
Age
1000
Name
Flame Princess
Age
21
Mobile View

Table Props

Prop NameProp TypeDescription
columnsobject[]Columns for the table
columns[].enableSort
booleanWhether the column is sortable; requires onSort prop
columns[].headerCell
(headerIndex, headerLabel) => React.ReactNodeCustom rendering for the header cell
columns[].index
string | numberUnique identifier for the column
columns[].label
anyLabel for the column
columns[].rowCell
objectCustom rendering for the row cell
columns[].rowCell[].headerIndex
string | numberUnique identifier for the row cell
columns[].rowCell[].headerLabel
anyLabel for the row cell
columns[].rowCell[].rowCellIndex
string | numberUnique identifier for the row cell
columns[].rowCell[].rowCellLabel
anyLabel for the row cell
customSortIconAscReact.ReactNodeCustom sort icon for ascending order
customSortIconDescReact.ReactNodeCustom sort icon for descending order
defaultSortOrder{ index, order }[]Default Sort Order object for columns
disabledbooleanDisables user interaction
headerRowCellPropsHTMLAttributesProps for the header row cells
headerRowPropsHTMLAttributesProps for the header row
isMobilebooleanWhether the table is in mobile view
mobileCellKeyPropsHTMLAttributesProps for the mobile cell key
mobileCellValuePropsHTMLAttributesProps for the mobile cell value
onSort({ index, order }) => voidCallback for when a column is sorted; required for table sorting
paginationPropsPaginationProps for the table pagination component
rowCellPropsHTMLAttributesProps for the row cells
rowPropsHTMLAttributesProps for the rows
rowsobject[]Rows for the table
rows[].cells
object[]Cells for the row
rows[].cells[].index
string | numberUnique identifier for the row cell
rows[].cells[].label
anyLabel for the row cell
rows[].cells[].render
(rowCellIndex, rowCellLabel) => React.ReactNodeCustom rendering for the row cell
showPaginationbooleanWhether to show table pagination
simplebooleanSimple table with no styles
sortIconPropsHTMLAttributesProps for the sort icon