#123
Simple mode
A DataTable with five columns and 12 user rows, passing only `columns` and `data`.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Simple mode" pattern (@codeatlasdev/ui demo #123, display/data-table) in my app.
Call get_demo({ ids: ["#123"] }) first and keep its structure. It needs @codeatlasdev/[email protected] + @tanstack/svelte-table.
Use: The minimal setup for a table of records defined with a column helper.
Keep these library parts, with the props and tokens the demo uses:
- DataTable, createCaColumnHelper from "@codeatlasdev/ui/table"
Behaviour to keep:
- `createCaColumnHelper<User>()` and `col.columns([` define 5 columns: ID, Name, Email, Role, Status
- `col.accessor('id', { header: 'ID', meta: { label: 'ID' } })` shows the accessor shape
- `const data: User[]` has 12 rows with `id`, `name`, `email`, `role` and `status`
- `<DataTable {columns} {data} />` has no other props
- Wrapper `.wrap` has `width: 100%`
Reduced motion: the demo handles it; keep that branch.
Keyboard: operable; keep the focus order and key handling.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
- DataTable
@codeatlasdev/ui/table
How it is built
- `createCaColumnHelper<User>()` and `col.columns([` define 5 columns: ID, Name, Email, Role, Status
- `col.accessor('id', { header: 'ID', meta: { label: 'ID' } })` shows the accessor shape
- `const data: User[]` has 12 rows with `id`, `name`, `email`, `role` and `status`
- `<DataTable {columns} {data} />` has no other props
- Wrapper `.wrap` has `width: 100%`
Related
Loading source.