DataTable

Data Display

Advanced data grid with sorting, filtering, pagination, row selection, inline editing, and virtualization for large datasets

DataTable

A flexible data grid with sorting, pagination, loading states and compact header layout built for Saha UI. Use the component API for fast setup or the compact header for dashboard lists.

Basic usage

Pass data and columns to DataTable. Enable the global filter for simple search and configure the page size for pagination.

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Liam Brown[email protected]Editorsuspended
Sophia Patel[email protected]Vieweractive
Showing 1 to 5 of 5 results
Rows per page:
Page 1 of 1

This example shows a searchable, paginated table with a primary variant.

Variants

Use the variant prop to change table chrome. This is useful for dashboards where different tables indicate emphasis or semantic meaning.

Default variant

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Showing 1 to 3 of 5 results
Page 1 of 2

Glass variant

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Showing 1 to 3 of 5 results
Page 1 of 2

Primary variant

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Showing 1 to 3 of 5 results
Page 1 of 2

Outline variant

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Showing 1 to 3 of 5 results
Page 1 of 2

Sizes & density

Adjust the size to make rows more compact or spacious. This controls padding and font-size.

Small

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Liam Brown[email protected]Editorsuspended
Showing 1 to 4 of 5 results
Page 1 of 2

Medium (default)

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Liam Brown[email protected]Editorsuspended
Showing 1 to 4 of 5 results
Page 1 of 2

Large

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Liam Brown[email protected]Editorsuspended
Showing 1 to 4 of 5 results
Page 1 of 2

Striped rows

Use the striped prop for zebra rows. This improves readability for dense data tables.

Odd rows striped

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Liam Brown[email protected]Editorsuspended
Sophia Patel[email protected]Vieweractive
Showing 1 to 5 of 5 results
Page 1 of 1

Even rows striped

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Liam Brown[email protected]Editorsuspended
Sophia Patel[email protected]Vieweractive
Showing 1 to 5 of 5 results
Page 1 of 1

Loading & empty states

Show a skeleton while fetching data with the loading prop, and provide custom content for empty tables using emptyComponent.

Loading

Loading...
Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Liam Brown[email protected]Editorsuspended
Sophia Patel[email protected]Vieweractive
Showing 1 to 5 of 5 results
Rows per page:
Page 1 of 1

Custom empty state

Name
Email
Role
Status
📭

No users found yet

Get started by creating your first user.

Borders & layout

Toggle outer borders with bordered. Borderless tables blend into cards or surfaces.

With border (default)

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Liam Brown[email protected]Editorsuspended
Showing 1 to 4 of 5 results
Page 1 of 2

Borderless table

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Liam Brown[email protected]Editorsuspended
Showing 1 to 4 of 5 results
Page 1 of 2

Compact header layout

Use DataTableCompact to render a header with title, description, actions and search above the table. Perfect for dashboard cards and management screens.

User management

Manage members of your workspace.

Name
Email
Role
Status
Olivia Martin[email protected]Adminactive
Jackson Lee[email protected]Editoractive
Isabella Nguyen[email protected]Viewerinvited
Liam Brown[email protected]Editorsuspended
Sophia Patel[email protected]Vieweractive
Showing 1 to 5 of 5 results
Rows per page:
Page 1 of 1

Usage Guidelines

When to Use

  • Large datasets
  • Sortable/filterable data
  • CRUD tables

Accessibility

  • Proper table semantics
  • Sortable columns announced

Performance

  • Virtualization for large data
  • Efficient column rendering

Common Mistakes

  • All columns same width
  • Not paginating large datasets

Frequently Asked Questions

Yes, DataTable uses virtualization for large datasets with thousands of rows.
Yes, DataTable supports sortable, filterable, and resizable columns.

View on GitHub

See the full source code on GitHub