Components
Table
A responsive table component.
| Invoice | Status | Method | Amount |
|---|---|---|---|
| INV001 | Paid | Credit Card | $250.00 |
| INV002 | Pending | PayPal | $150.00 |
| INV003 | Unpaid | Bank Transfer | $350.00 |
| INV004 | Paid | Credit Card | $450.00 |
| INV005 | Paid | PayPal | $550.00 |
| INV006 | Pending | Bank Transfer | $200.00 |
| INV007 | Unpaid | Credit 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
Footer
| Invoice | Status | Method | Amount |
|---|---|---|---|
| INV001 | Paid | Credit Card | $250.00 |
| INV002 | Pending | PayPal | $150.00 |
| INV003 | Unpaid | Bank Transfer | $350.00 |
| Total | $2,500.00 | ||
Actions
| Product | Price | Actions |
|---|---|---|
| Wireless Mouse | $29.99 | |
| Mechanical Keyboard | $129.99 | |
| USB-C Hub | $49.99 |