A shadcn/ui registry that provides a data-grid component built on top of react-data-grid, themed to match your shadcn design system using CSS variables.
The registry item ships:
DataGrid— re-exported fromreact-data-gridwith full TypeScript supportSelectEditor— inline dropdown editor for string enum columnsBooleanEditor— inline Yes/No dropdown editor for boolean columnsNumberEditor— inline number input editor for numeric columns- CSS theming —
.rdg,.rdg-header-row .rdg-cell, and.rdg-celloverrides wired to your shadcn tokens (--card,--muted,--border,--ring, etc.)
npx shadcn@latest add https://raw.githubusercontent.com/htmujahid/shadcn-data-grid/master/public/r/data-grid.jsonThis will:
- Install
react-data-gridas a dependency - Copy
src/components/ui/data-grid.tsxinto your project - Inject the
.rdgCSS theming into your global CSS file
import { DataGrid, SelectEditor, BooleanEditor, NumberEditor } from "@/components/ui/data-grid";
import type { Column } from "react-data-grid";
interface Row {
id: number;
title: string;
status: string;
active: boolean;
priority: number;
}
const columns: Column<Row>[] = [
{ key: "id", name: "ID", width: 60 },
{ key: "title", name: "Title" },
{
key: "status",
name: "Status",
renderEditCell: (props) => (
<SelectEditor {...props} options={["Todo", "In Progress", "Done"]} />
),
},
{ key: "active", name: "Active", renderEditCell: BooleanEditor },
{ key: "priority", name: "Priority", renderEditCell: NumberEditor },
];
export function MyGrid() {
const [rows, setRows] = useState<Row[]>(initialRows);
return (
<DataGrid
columns={columns}
rows={rows}
onRowsChange={setRows}
rowKeyGetter={(row) => row.id}
defaultColumnOptions={{ resizable: true }}
/>
);
}- Vite + React 19 + TypeScript
- Tailwind CSS v4
- shadcn/ui (base-nova preset)
- react-data-grid