Skip to content

DataTable

DataTable

jsx
import DataTable from 'intergalactic/data-table';
<DataTable />;

DataTableProps

& {...} &
NameTypeDescription
use Table theme according to visual hierarchy on the page
data {[key: string]:any }[] Data for table
sortDataTableSort<keyof {[key: string]:any }[][0]> Active sort object
onSortChange(sort: DataTableSort<keyof {[key: string]:any }[][0]>, e: React.SyntheticEvent) => void Handler call when request will change sort
uniqueKeykeyof {[key: string]:any }[][0] Field name in one data entity that is unique accross all dataset
compactboolean Make cells compact by changing left and right paddings to smaller ones
totalRowsnumber Count of total rows if table using virtual scroll. Needs for accessibility

DataTable.Head

jsx
import DataTable from 'intergalactic/data-table';
<DataTable.Head />;

DataTableHeadProps

& {...}
NameTypeDescription
stickyboolean Sticky table header
hiddenboolean Hidden header
disabledScrollboolean Disabled scroll (as action)
withScrollBarboolean Enable scroll bar element in header
animationsDisabledboolean Disables column width change animation *

DataTable.Column

jsx
import DataTable from 'intergalactic/data-table';
<DataTable.Column />;

DataTableColumnProps

& {...}
NameTypeDescription
namestring Unique column name
sortableboolean | "desc" | "asc" Enable sorting for column. And if you are passing a string, you can also set the default sorting
resizableboolean Enable resize for column
fixed"left" | "right" Fix column on the left o right side of the table
flexProperty.Flex | "inherit" Fields to control the size of the column
vBordersboolean Add vertical border to the column
borderRightboolean Add vertical border to the right side of the cell
borderLeftboolean Add vertical border to the left side of the cell
changeSortSizeboolean Enable changing column width with sort icon
sortSizeRecalculationboolean Enable column to use as a column for recalculation width

DataTable.Body

jsx
import DataTable from 'intergalactic/data-table';
<DataTable.Body />;

It's a wrapper over a Box component.

DataTable.Row

jsx
import DataTable from 'intergalactic/data-table';
<DataTable.Row />;

DataTableRowProps

& {...}
NameTypeDescription
theme Theme for row
activeboolean Sets row state to active

DataTable.Cell

jsx
import DataTable from 'intergalactic/data-table';
<DataTable.Cell />;

DataTableCellProps

& {...}
NameTypeDescription
namestring Unique name for column or columns separated by /
theme Theme for cell

Released under the MIT License.

Released under the MIT License.