Componentdata1.22 KB gzipZero dependencies

Data Grid

Heavy data grid: sortable columns, pagination, sticky header.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add data-grid

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { DataGrid } from "@/components/ui/data-grid"; <DataGrid />

Source code

data-grid.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxdata-grid.tsx120 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface DataGridColumn<T> {  key: string;  header: string;  /** Custom cell renderer function */  render?: (row: T) => React.ReactNode;  /** Enables sorting by this column */  sortable?: boolean;} export interface DataGridProps<T extends Record<string, unknown>> extends React.HTMLAttributes<HTMLDivElement> {  columns: DataGridColumn<T>[];  rows: T[];  rowKey?: (row: T) => string;

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { DataGrid } from "@/components/ui/data-grid"; <DataGrid />
PropTypeDescription
columnsDataGridColumn<T>[]Column definitions describing headers, cell keys, and sorting. (Default: [])
rowsT[]Configures rows. (Default: [])
rowKey(row: T) => stringConfigures row key.
pageSizenumberConfigures page size. (Default: 8)
emptyMessagestringConfigures empty message. (Default: "No records found")