A spreadsheet surface with sorting, range selection, in-place editing with undo and redo, copy as TSV, CSV export and a status bar that sums the selection.
pnpm dlx shadcn@latest add @beautiful-ui-pro/data-gridNeeds your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Import it and pass your content. The props that matter most are listed next.
"use client";
import { DataGrid, type DataGridColumn } from "@/components/ui/notchset/data-grid";
type EvalCase = { id: string; input: string; score: number; status: string };
const columns: DataGridColumn<EvalCase>[] = [
{ key: "id", label: "CASE", width: 92 },
{ key: "input", label: "INPUT", width: 260, editable: true },
{ key: "score", label: "SCORE", width: 80, type: "number", editable: true, min: 0, max: 100 },
{ key: "status", label: "STATUS", width: 92, dot: (r) => (r.status === "PASS" ? "ink" : "signal") },
];
const cases: EvalCase[] = [
{ id: "pc-0001", input: "Summarise the migration evals", score: 91, status: "PASS" },
{ id: "pc-0002", input: "Find the cheapest model for triage", score: 72, status: "FAIL" },
];
// Stable functions: the grid rebuilds its view when they change.
const rowId = (r: EvalCase) => r.id;
const derive = (r: EvalCase) => ({ ...r, status: r.score >= 80 ? "PASS" : "FAIL" });
export function EvalCases() {
return <DataGrid columns={columns} rows={cases} rowId={rowId} derive={derive} csvName="cases.csv" />;
}columns–
{ key, label, width, type?, editable?, min?, max?, format?, muted?, dot? }[]Columns; the first is sticky.
rows / rowId–
T[] / (row) => stringData and identity.
query / derive / csvName–
string / (row) => row / stringSearch, recomputed fields, export name.
components/ui/notchset/data-grid.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.