Examples

1. Quick Start: Products Table

The simplest TableCraft setup:

import { defineTable } from '@tablecraft/engine';
import { products } from '../db/schema';

export const productsConfig = defineTable(products)
  .name('products')
  .search('name')
  .sort('-createdAt')
  .pageSize(20)
  .toConfig();

Advanced Custom Filters with URL State

Build complex UI filters (multi-select, dynamic operators, checkboxes) synced directly to the URL. The engine supports operators like in, isNotNull, gte, and automatically drops falsy values.

Learn more about building Custom Filters →

2. Type-Safe with Codegen

Generate types for full type safety:

3. The "Kitchen Sink" User Table

A comprehensive user configuration with security, search, and transforms.

4. Analytics Report (Group By)

Get total sales grouped by product category.

5. Nested E-commerce Fetch

Fetch Orders with their Line Items and the associated Product details.

6. Recursive Category Tree

Fetch a category tree (Electronics -> Computers -> Laptops).

7. Date Filtering with Custom Column

Specify which date column to use for the global date picker:

8. Disable Date Filter

Tables without date columns won't show date picker, but you can also disable explicitly:

9. Custom Toolbar

Add custom content to the DataTable toolbar:

10. Conditional Column Visibility

Hide columns based on user role:

11. Custom Column Rendering (Column Overrides)

Customize how column values are displayed in the table using columnOverrides. This allows you to transform data presentation without modifying the backend.

circle-info

columnOverrides receives an object with value, row, and table for maximum flexibility.

12. Row Actions

Add row-level actions (Edit, Delete, etc.) using the actions prop. This renders an action menu for each row.

circle-info

The actions callback receives { row, table } where row is the current row data and table provides utilities like table.totalSelected for bulk operations.

13. E-commerce Dashboard

A comprehensive e-commerce dashboard example demonstrating nested relations, total counts, and advanced column overrides.

Last updated

Was this helpful?