ComponentsBlocksDocsExamples

Alert
Calendar
Card
Chart
Data Grid
Update
Drawer
File Upload
Kanban
Kbd
Pagination
Resizable
Rating
Stepper
Scrollspy
Skeleton
Sortable
Sonner
Table
Textarea

Components

Data Grid

UI Library:

A powerful data grid component built on top of TanStack Table v8 with features like sorting, filtering, pagination, and drag & drop support.

Installation

pnpm dlx shadcn@latest add @toui/data-grid

Examples

Cell Border

Dense Table

Light

Striped

Auto Width

Row Selection

Expandable Row

Sub Data Grid

Column Icons

Sortable Columns

Movable Columns

Draggable Columns

Draggable Rows

Resizable Columns

Pinnable Columns

Sticky Header

Column Controls

Card Container

Column Visibility

Loading Skeleton

CRUD

API Reference

This section provides a comprehensive overview of the data grid components, detailing their custom props and linking to relevant documentation.

DataGrid

This component is based on the DataGrid from TanStack Table and includes the following custom props:

PropTypeDefault
className string
table Table<TData>
recordCount number
children ReactNode
onRowClick (row: TData) => void
isLoading booleanfalse
loadingMode enum skeleton
loadingMessage ReactNode | string
emptyMessage ReactNode | string"No data available"
tableLayout objectSee below
tableClassNames objectSee below

Table Layout Props - tableLayout

PropTypeDefault
dense booleanfalse
cellBorder booleanfalse
rowBorder booleantrue
rowRounded booleanfalse
stripped booleanfalse
headerBackground booleantrue
headerBorder booleantrue
headerSticky booleanfalse
width 'auto' | 'fixed''fixed'
layout object'fixed'
columnsVisibility booleanfalse
columnsResizable booleanfalse
columnsPinnable booleanfalse
columnsMovable booleanfalse
columnsDraggable booleanfalse
rowsDraggable booleanfalse

Table Class Names - tableClassNames

PropTypeDefault
base string
header string
headerRow string
headerSticky string"sticky top-0 z-10 bg-background/90 backdrop-blur-xs"
body string
bodyRow string
footer string
edgeCell string

DataGridColumnFilter

This component provides filtering capabilities for data grid columns. It utilizes TanStack Table Columns for column management and filtering.

PropTypeDefault
column Column<TData, TValue>
title string
options Array

DataGridColumnHeader

This component provides a header for data grid columns, including sorting and pinning controls. It is built on top of TanStack Table Header for efficient data management.

PropTypeDefault
column Column<TData, TValue>
title string
icon ReactNode
filter ReactNode

DataGridColumnVisibility

This component provides controls for toggling the visibility of data grid columns. It utilizes TanStack Table Column Visibility for managing column visibility.

PropTypeDefault
table Table<TData>
trigger ReactNode

DataGridPagination

This component provides pagination controls for the data grid. It is built on top of TanStack Table Pagination for efficient data management.

PropTypeDefault
sizes number[][5, 10, 25, 50, 100]
sizesLabel string"Show"
sizesDescription string"per page"
sizesInfo string
sizesSkeleton ReactNode
more booleanfalse
moreLimit number5
info string"{from} - {to} of {count}"
infoSkeleton ReactNode
className string
rowsPerPageLabel string"Rows per page"
previousPageLabel string"Go to previous page"
nextPageLabel string"Go to next page"
ellipsisText string"..."

DataGridTableDnd

This component provides drag-and-drop functionality for data grid rows and columns using Dnd Kit.

PropTypeDefault
handleDragEnd (event: DragEndEvent) => void

DataGridTable

This component provides the table structure for the data grid, including headers, rows, and cells. It is built on top of TanStack Table for efficient data management.

PropTypeDefault
children ReactNode

ColumnMeta Interface

This interface is used to define custom metadata for columns in the data grid. It is built on top of ColumnMeta.

PropTypeDefault
headerTitle string
headerClassName string
cellClassName string
skeleton ReactNode
expandedContent (row: TData) => ReactNode

Credits

  • Built with TanStack Table.
  • Built with DndKit.
PreviouseChartNextDrawer

On This Page

  • Installation
  • Examples
    • Cell Border
    • Dense Table
    • Light
    • Striped
    • Auto Width
    • Row Selection
    • Expandable Row
    • Sub Data Grid
    • Column Icons
    • Sortable Columns
    • Movable Columns
    • Draggable Columns
    • Draggable Rows
    • Resizable Columns
    • Pinnable Columns
    • Sticky Header
    • Column Controls
    • Card Container
    • Column Visibility
    • Loading Skeleton
    • CRUD
  • API Reference
    • DataGrid
    • DataGridColumnFilter
    • DataGridColumnHeader
    • DataGridColumnVisibility
    • DataGridPagination
    • DataGridTableDnd
    • DataGridTable
    • ColumnMeta Interface
  • Credits

We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking Accept, you agree to our use of cookies.
Learn more.

Token UI

Components

  • Overview
  • Pricing
  • Marketplace
  • Features
  • Integrations
  • Pricing

Blocks

  • Charts
  • Team
  • Blog
  • Careers
  • Contact
  • Privacy

Examples

  • Help
  • Sales
  • Advertise

Docs

  • Twitter
  • Instagram
  • LinkedIn

© 2025 TOUI.dev. All rights reserved.

  • Terms and Conditions
  • Privacy Policy