Data Table

Full-featured data table with sorting, searching, pagination, row selection, and column visibility.

Import

import { DataTable } from "poyraz-ui/organisms";
import type { DataTableColumnDef } from "poyraz-ui/organisms";

Full Featured

Table with search, sort, pagination, row selection, and column toggle.

NameEmailRoleStatus
Ali Yılmazali@example.comAdmin
active
Ayşe Demirayse@example.comEditor
active
Mehmet Kayamehmet@example.comViewer
inactive
Zeynep Çelikzeynep@example.comEditor
active
Can Öztürkcan@example.comAdmin
active

Showing 15 of 12 results

1 / 3
const columns: DataTableColumnDef<User>[] = [
  { id: "name", header: "Name", accessorKey: "name", sortable: true, filterable: true },
  { id: "email", header: "Email", accessorKey: "email", sortable: true },
  { id: "role", header: "Role", accessorKey: "role", sortable: true, filterable: true },
  {
    id: "status",
    header: "Status",
    accessorKey: "status",
    sortable: true,
    cell: (row) => (
      <Badge variant={row.status === "active" ? "default" : "outline"}>
        {row.status}
      </Badge>
    ),
  },
];

<DataTable
  columns={columns}
  data={users}
  getRowId={(row) => row.id}
  pageSize={5}
  selectable
  columnToggle
  searchPlaceholder="Search users..."
/>

Simple Table

Minimal table without selection or column toggle.

ProductPriceStock
Keyboard$59120
Mouse$29340
Monitor$39945
Headset$89200
Webcam$4980
<DataTable
  columns={productColumns}
  data={products}
  pageSize={10}
  searchable={false}
  pagination={false}
/>