# Builder

> Visually build a table schema from JSON data or CSV

Source: https://data-table.openstatus.dev/docs/builder · Docs index: https://data-table.openstatus.dev/llms.txt · Full docs: https://data-table.openstatus.dev/llms-full.txt

The [/builder](/builder) page lets you visually build a table schema:

1. **Paste JSON data** (or upload a CSV) in the left panel
2. Click **Generate Schema** — the schema is auto-inferred from your data
3. A **live table preview** appears with filters, sorting, and row details
4. Edit the **Schema JSON** directly and click **Apply** for instant updates
5. Click **Export TS** to copy the generated `createTableSchema(...)` code

## Type Inference

The inference engine detects column types from your data:

- ISO 8601 strings / Unix-ms numbers → `timestamp` + `timerange` filter
- Booleans → `boolean` + `checkbox` filter
- Numbers with varying values → `number` + `slider` filter
- Strings with ≤10 distinct values → `enum` + `checkbox` filter
- Arrays of strings → `array` with enum items
- Plain objects → `record` (not filterable)

Post-inference heuristics apply smart defaults (ID-like → code display, latency → "ms" unit, log level → `defaultOpen`, etc.).

> The same inference engine powers the [zero-config DataTableAuto](/auto) component — pass raw data and get a fully rendered table with no schema definition needed.

## Example Datasets

Example datasets (Pokemon, HTTP Logs, Space Missions, Cocktails, Orders, Issues, Movies, RPG Characters) are included to explore different configurations.

## Serialization & AI

The schema serializes to a function-free JSON descriptor for AI agents, MCP tools, or remote storage.

```ts
// Schema → JSON
const json = tableSchema.toJSON();
// JSON.stringify(tableSchema) also works

// JSON → Schema (e.g. from an AI agent)
const reconstructed = createTableSchema.fromJSON(json);

// JSON → TypeScript code
import { schemaToTypeScript } from "@/lib/table-schema/to-typescript";
const tsCode = schemaToTypeScript(json);
```

> Custom renderers (`display("custom", ...)`, `filter.component`, `sheet.component`) are functions and cannot be serialized. They are stripped during `toJSON()` and must be applied manually on reconstructed schemas.
