Skip to content

DataTable

DataTable

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

DataTableProps

& {...}
NameTypeDescription
useTable 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) => voidHandler call when request will change sort
uniqueKeykeyof {[key: string]:any}[][0]Field name in one data entity that is unique accross all dataset
compactbooleanMake 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
stickybooleanSticky table header
hiddenbooleanHidden header
disabledScrollbooleanDisabled scroll (as action)
withScrollBarbooleanEnable scroll bar element in header
animationsDisabledbooleanDisables 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
namestringUnique column name
sortableboolean | "desc" | "asc"Enable sorting for column. And if you are passing a string, you can also set the default sorting
resizablebooleanEnable 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
vBordersbooleanAdd vertical border to the column
borderRightbooleanAdd vertical border to the right side of the cell
borderLeftbooleanAdd 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
themeTheme for row
activebooleanSets 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
namestringUnique name for column or columns separated by /
themeTheme for cell

Released under the MIT License.

Released under the MIT License.