BalanceReckon Design System
Others

Data Table

Data tables display information in a way that's easy to scan, so that users can look for patterns and insights.

import { DataTable, sortTableData } from '@balance-web/data-table';
Loading demo…

The DataTable component has been deprecated and will be removed in a future version. Use Table instead.

Usage

Ensure that Text uses the xsmall size for consistency. Empty table cells should display an em dash (—).

Loading demo…

Sortable

Passing the sort prop and onSortChange callback will allow the user to change the sort order of the data.

We export a handy sortTableData function for this purpose. You should only use sortTableData if your data set is small and exists entirely in-memory, otherwise sorting should be implemented by sorting in the actual database.

Loading demo…

Overflow

When there isn't enough horizontal space to fit all the columns comfortably, you may introduce scrolling behaviour by setting the allowOverflow property.

Loading demo…

Custom rendering

Use the render prop to customise how cells in a row will be rendered.

Loading demo…

You may optionally render a table footer using the renderFooter function.

Loading demo…

Empty state

Use the emptyState property to show the user something when there's no data to show. This is typically useful when the table is showing filterable data. The emptyState element is only shown when the rowCount is 0.

Loading demo…

Cell attributes

Use the cellAttributes function to apply styles, custom data-attributes, or anything else you need on a given table cell.

Loading demo…

On this page