Documentation
Components
DataTable

Data Table

A powerful and flexible component for displaying and managing tabular data, offering features such as sorting, filtering, pagination, and customizable columns to efficiently present large datasets in a user-friendly format.

Installation

Install the package

npm i @start-base/start-ui

Add the styles

To use the React form elements styles in a Next.js project, import the styles in your layout.tsx file.

app/layout.tsx
import "@start-base/start-ui/styles.css";

Import the component

import DataTable from '@start-base/start-ui/DataTable';

Usages

DataTable with Pagination

Name
Age
Email
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
1-5 of 6

DataTable with Border

Name
Age
Email
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]

DataTable Without Border

Name
Age
Email
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]

Virtual Table

Name
Age
Email
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]

DataTable With Custom Empty Text

Name
Age
Email
Nothing to show here.

Row Selection with a Custom Action

Name
Age
Email
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]

Row Selection with Checkboxes

Name
Age
Email
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]

DataTable with Title

User Information
Name
Age
Email
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]

DataTable With Filter

Filtering Enabled Table
Name
Age
Email
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]

DataTable With Sorting

Name
Age
Email
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]
John Doe28[email protected]
Jane Smith34[email protected]
Alice Johnson45[email protected]
Bob Brown52[email protected]
Clara Davis24[email protected]
Daniel Green38[email protected]

API

NameTypeDefaultDescription
dataarrayData to be displayed in the table
columnsarrayColumns configuration of the table
rowsPerPagenumber5Number of rows per page when pagination is enabled
paginationbooleanfalseWhether to enable pagination
rowsPerPageOptionsarray[5, 10, 20]Options for rows per page in pagination
borderbooleantrueWhether to show border around the table and its rows
rowSelectbooleanfalseWhether to enable row selection
rowSelectAction(selectedRows: (string | number)[]) => voidCallback function when rows are selected
checkboxAvailablebooleanfalseWhether to enable checkbox selection of rows
titlestring | ReactNodeTitle of the table
filterbooleanfalseWhether to enable filtering functionality
sortingbooleanfalseWhether to enable sorting functionality
virtualizedbooleanfalseWhether to enable virtual scrolling for large datasets
emptyTextstringText displayed when there's no data
rowClassNamestringClass name applied to table rows
maxHeightnumber340Maximum height of the table