Skip to content

DataTable

DataTable

jsx
import DataTable from 'intergalactic/data-table';
<DataTable />;
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

DataTable.Head

jsx
import DataTable from 'intergalactic/data-table';
<DataTable.Head />;
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 />;
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

DataTable.Body

jsx
import DataTable from 'intergalactic/data-table';
<DataTable.Body />;
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 />;
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 />;
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.