OPUS/UI

Navigation

Data Table

hot

Typed data table — click-to-sort headers (aria-sort), row selection with page-level select-all, paging, sticky header, empty state.

2 files · 235 locdeps: clsx, tailwind-merge
Customers
Trend
AL

Ada Lovelace

[email protected]

OwnerActive$120
GH

Grace Hopper

[email protected]

AdminSuspended$839
AT
MemberInvited$658
KJ

Katherine Johnson

[email protected]

ViewerActive$477
LT

Linus Torvalds

[email protected]

OwnerActive$296
MH

Margaret Hamilton

[email protected]

AdminSuspended$1,015
1–6 of 12
1 / 2

Installation

With the shadcn CLI, pointing at this platform’s registry:

npx shadcn@latest add https://opusui.131199999.xyz/r/table.json

Or offline, straight from your opus55 checkout (copies every file it needs):

node ../tailwind_component/opus55/scripts/add.mjs table

Usage

import { DataTable, type Column } from "@/components/opus/ui/table";

const columns: Column<User>[] = [
  { key: "name", header: "Name", sortValue: (u) => u.name },
  { key: "mrr", header: "MRR", align: "right", sortValue: (u) => u.mrr },
];
<DataTable columns={columns} rows={users} rowKey={(u) => u.id} selectable pageSize={10} />

API

PropTypeDefaultDescription
columnsColumn<T>[]—{ key, header, cell?, sortValue?, align?, width? }
rows / rowKeyT[] / (row) => string—Data.
selectable / selected / onSelectedChangeboolean / string[]—Row selection.
pageSizenumber0Client paging (0 = off).
striped / dense / maxHeight / onRowClick / empty——Presentation & behaviour.

Command palette