Skip to content
Browse library
BIU UI/Components/Data Table
COMPONENTS

Data Table

Explore the Data Table component and try its interactive examples.

INTERACTIVE PREVIEW

Preview

Loading preview…
GET STARTED

Installation

Install the component source via shadcn Registry, the BIU CLI, or as an npm package.

TERMINAL / pnpm
pnpm dlx shadcn add @biudev/data-table

First time using @biudev? Map "@biudev": "https://ui.biu.dev/r/0.1.0/{name}.json" under registries in your components.json (see setup).

Usage

Start with this example, then adjust the import path for your project.

EXAMPLE / TSX
"use client";
import { DataTable } from "@/components/ui/biu/data-table";

export function Example() {
  const rows = [
    { id: "1", customer: "Maya Labs", status: "Paid", amount: 240 },
    { id: "2", customer: "Nordic Cloud", status: "Pending", amount: 1200 },
  ];
  return (
    <DataTable
      data={rows}
      searchable
      selectable
      columnVisibility
      pageSize={5}
      columns={[
        { key: "customer", header: "Customer", sortable: true },
        { key: "status", header: "Status", sortable: true },
        { key: "amount", header: "Amount", sortable: true, align: "right", cell: (row) => `$${row.amount}` },
      ]}
    />
  );
}

Examples

Try each example or switch to its code.

API reference

Properties and defaults from the component source. An asterisk marks a required property; a dash means no explicit default.

DataTableSortDirection

Also accepts properties from 'asc' & 'desc'.

Some properties depend on the variant; consult the source for the full union.

DataTableSort

Also accepts properties from null.

Some properties depend on the variant; consult the source for the full union.

DataTableColumn

DataTableFilterOption

DataTableFilter

DataTableLabels

DataTableProps

Source

Review a formatted version of the component source used by the Registry.