Tulip Logo IconTulip
Components

Table

A responsive table component.

A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
INV004PaidCredit Card$450.00
INV005PaidPayPal$550.00
INV006PendingBank Transfer$200.00
INV007UnpaidCredit Card$300.00
Total$2,500.00

Usage

import {
  Table,
  TableBody,
  TableCaption,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from "@tulip-systems/core/data-tables";
<Table>
  <TableCaption>A list of your recent invoices.</TableCaption>
  <TableHeader>
    <TableRow>
      <TableHead className="w-[100px]">Invoice</TableHead>
      <TableHead>Status</TableHead>
      <TableHead>Method</TableHead>
      <TableHead className="text-right">Amount</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell className="font-medium">INV001</TableCell>
      <TableCell>Paid</TableCell>
      <TableCell>Credit Card</TableCell>
      <TableCell className="text-right">$250.00</TableCell>
    </TableRow>
  </TableBody>
</Table>

Local data strategy

When your rows already live in client state and you still want Tulip's table config, URL-synced sorting, and command integration, use useLocalStrategy() from @tulip-systems/core/data-tables/client.

"use client";

import type { TableColumnDef } from "@tulip-systems/core/data-tables";
import {
  createTableConfig,
  TableConfigProvider,
  useLocalStrategy,
} from "@tulip-systems/core/data-tables/client";

function CustomerLocalTableProvider({
  data,
  columns,
  children,
}: {
  data: { id: string; name: string }[];
  columns: TableColumnDef<{ id: string; name: string }>[];
  children: React.ReactNode;
}) {
  const strategy = useLocalStrategy({ total: data.length });

  const config = createTableConfig({
    queryData: data,
    columns,
    getRowId: (row) => row.id,
    strategy,
  });

  return <TableConfigProvider config={config}>{children}</TableConfigProvider>;
}

Use useLocalStrategy() when filtering or loading is handled locally and the table should only manage sorting and layout state. Use the infinite or pagination strategies when the server remains the source of truth for the current page.

Examples

A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
Total$2,500.00

Actions

ProductPriceActions
Wireless Mouse$29.99
Mechanical Keyboard$129.99
USB-C Hub$49.99

On this page