Griddy LogoGriddy Table Generator

CRUD Table Generator

Define your columns, enable the features you need, preview the results instantly, and copy production-ready frontend, backend, and Prisma schema code.

Columns

Features

Backend output

These settings are reflected in the generated frontend and backend code.

Preview

Interaktif preview dari konfigurasi tabel saat ini.

Filter Name
Select values...
Filter Age
Select values...
Filter Active
Select values...
IDCreatedUpdatedNameAgeEmailActiveJoined
19/20/2025, 5:30:44 PM9/20/2025, 5:30:44 PMBob95BobNo8/13/2025, 4:49:37 AM
29/19/2025, 5:30:44 PM9/20/2025, 5:30:44 AMFrank85CharlieYes6/15/2025, 11:36:26 PM
39/18/2025, 5:30:44 PM9/19/2025, 5:30:44 PMDiana24DianaNo9/11/2025, 5:23:46 AM
49/17/2025, 5:30:44 PM9/19/2025, 5:30:44 AMFrank93DianaYes2/17/2025, 10:31:50 AM
59/16/2025, 5:30:44 PM9/18/2025, 5:30:44 PMDiana91FrankNo5/19/2025, 3:54:43 PM
69/15/2025, 5:30:44 PM9/18/2025, 5:30:44 AMCharlie83CharlieNo11/3/2024, 6:26:56 PM
79/14/2025, 5:30:44 PM9/17/2025, 5:30:44 PMFrank18DianaYes11/28/2024, 6:38:21 AM
89/13/2025, 5:30:44 PM9/17/2025, 5:30:44 AMDiana57EvelynYes2/23/2025, 3:11:40 AM
99/12/2025, 5:30:44 PM9/16/2025, 5:30:44 PMFrank79CharlieYes10/12/2024, 5:38:11 PM
109/11/2025, 5:30:44 PM9/16/2025, 5:30:44 AMDiana29CharlieNo10/9/2024, 4:18:11 AM
Menampilkan 10 dari 25 baris
Page 1 of 3

Generated code

Choose which snippet to copy. Each panel updates instantly with the latest configuration.

frontend/PersonRecordTable.tsx

"use client";
import * as React from "react";
import {
ColumnDef,
flexRender,
getCoreRowModel,
getFilteredRowModel,
getGroupedRowModel,
getPaginationRowModel,
getSortedRowModel,
useReactTable,
} from "@tanstack/react-table";
export type PersonRecordRow = {
id: number;
createdAt: string;
updatedAt: string;
name: string;
age: number;
email: string;
isActive: boolean;
joinedAt: string;
};
export type PersonRecordTableProps = {
data: PersonRecordRow[];
};
const columns: ColumnDef<PersonRecordRow>[] = [
{
id: "id",
header: "ID",
accessorKey: "id",
enableSorting: true,
},
{
id: "createdAt",
header: "Created",
accessorKey: "createdAt",
enableSorting: true,
},
{
id: "updatedAt",
header: "Updated",
accessorKey: "updatedAt",
enableSorting: true,
},
{
id: "name",
header: "Name",
accessorKey: "name",
enableSorting: true,
enableGrouping: false,
enableColumnFilter: true,
},
{
id: "age",
header: "Age",
accessorKey: "age",
enableSorting: true,
enableGrouping: false,
enableColumnFilter: true,
},
{
id: "email",
header: "Email",
accessorKey: "email",
enableSorting: true,
enableGrouping: false,
enableColumnFilter: false,
},
{
id: "isActive",
header: "Active",
accessorKey: "isActive",
enableSorting: false,
enableGrouping: true,
enableColumnFilter: true,
},
{
id: "joinedAt",
header: "Joined",
accessorKey: "joinedAt",
enableSorting: true,
enableGrouping: false,
enableColumnFilter: false,
},
];
export const PersonRecordTable: React.FC<PersonRecordTableProps> = ({ data }) => {
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
getSortedRowModel: getSortedRowModel(),
getFilteredRowModel: getFilteredRowModel(),
getPaginationRowModel: getPaginationRowModel(),
getGroupedRowModel: getGroupedRowModel(),
});
return (
<div className="flex flex-col gap-4">
<div className="overflow-x-auto rounded border">
<table className="w-full min-w-[720px] border-collapse text-sm">
<thead className="bg-gray-50">
{table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id}>
{headerGroup.headers.map((header) => (
<th key={header.id} className="border-b px-4 py-2 text-left font-medium">
{header.isPlaceholder
? null
: (
<button type="button" onClick={header.column.getToggleSortingHandler()}>
{flexRender(header.column.columnDef.header, header.getContext())}
</button>
)}
</th>
))}
</tr>
))}
</thead>
<tbody>
{table.getRowModel().rows.map((row) => (
<tr key={row.id} className="border-b last:border-0">
{row.getVisibleCells().map((cell) => (
<td key={cell.id} className="px-4 py-2">
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</td>
))}
</tr>
))}
</tbody>
</table>
</div>
</div>
);
};