ui-sdk-table-react 0.0.0-stage → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +8 -2
  3. package/docs/api-react.md +312 -0
  4. package/docs/cell-editing.md +246 -0
  5. package/docs/cells-and-slots.md +127 -0
  6. package/docs/component-body.md +33 -0
  7. package/docs/component-cell.md +31 -0
  8. package/docs/component-col.md +31 -0
  9. package/docs/component-edit-error.md +31 -0
  10. package/docs/component-editor.md +31 -0
  11. package/docs/component-fill-handle.md +31 -0
  12. package/docs/component-foot.md +31 -0
  13. package/docs/component-head.md +31 -0
  14. package/docs/component-header-cell.md +31 -0
  15. package/docs/component-header-row.md +33 -0
  16. package/docs/component-plain-row.md +31 -0
  17. package/docs/component-resizer.md +33 -0
  18. package/docs/component-root.md +36 -0
  19. package/docs/component-row.md +33 -0
  20. package/docs/component-spacer.md +31 -0
  21. package/docs/controller-and-view.md +104 -0
  22. package/docs/examples-agents.md +50 -0
  23. package/docs/examples-column-definitions.md +179 -0
  24. package/docs/examples-formula-writer.md +276 -0
  25. package/docs/examples-styling.md +173 -0
  26. package/docs/examples.md +114 -0
  27. package/docs/excel-formulas.md +115 -0
  28. package/docs/export.md +96 -0
  29. package/docs/fill.md +126 -0
  30. package/docs/first-table.md +150 -0
  31. package/docs/formats.md +176 -0
  32. package/docs/groups-and-totals.md +118 -0
  33. package/docs/history.md +126 -0
  34. package/docs/installation.md +52 -0
  35. package/docs/llms.txt +13 -0
  36. package/docs/pages-and-server-mode.md +246 -0
  37. package/docs/range-copy-and-paste.md +115 -0
  38. package/docs/react.md +85 -0
  39. package/docs/reference-columns.md +179 -0
  40. package/docs/reference-controller.md +137 -0
  41. package/docs/reference-export.md +59 -0
  42. package/docs/reference-formulas.md +42 -0
  43. package/docs/reference-implementation.md +29 -0
  44. package/docs/reference-messages.md +55 -0
  45. package/docs/reference-view.md +116 -0
  46. package/docs/row-numbers-and-letters.md +112 -0
  47. package/docs/rows.md +350 -0
  48. package/docs/selection-and-keyboard.md +151 -0
  49. package/docs/sheet-formulas.md +329 -0
  50. package/docs/sheet-options.md +214 -0
  51. package/docs/skills.md +41 -0
  52. package/docs/sort-filter-and-search.md +260 -0
  53. package/docs/state-and-events.md +90 -0
  54. package/docs/styled-table.md +237 -0
  55. package/docs/table-components.md +105 -0
  56. package/package.json +45 -3
  57. package/src/index.ts +62 -0
  58. package/src/reference.ts +113 -0
@@ -0,0 +1,127 @@
1
+ # Cells and slots
2
+
3
+ Put your own content in a header, a cell, a footer or the empty table, and give rows and cells your own attributes.
4
+
5
+ When composing the parts yourself, put your content inside the cell part. The [reference implementation](./reference-implementation.md) also lets you replace content by name. For example, `col-state` replaces only the cells of the `state` column; all other data cells still show their formatted text.
6
+
7
+ Pass render functions in the reference `Table`’s `slots` prop, for example `slots={{ 'col-state': ({ text }) => <mark>{text}</mark> }}`.
8
+
9
+ ```tsx title="slots.tsx"
10
+ 'use client'
11
+
12
+ import { Table } from 'ui-sdk-table-react/reference'
13
+ import type { ColumnDef } from 'ui-sdk-table-core'
14
+
15
+ type Task = {
16
+ id: string
17
+ title: string
18
+ owner: string
19
+ state: 'todo' | 'doing' | 'done'
20
+ hours: number
21
+ }
22
+
23
+ const tasks: Task[] = [
24
+ { id: 't1', title: 'Write the release notes', owner: 'Ada', state: 'doing', hours: 3 },
25
+ { id: 't2', title: 'Fix the login page', owner: 'Tomas', state: 'done', hours: 5 },
26
+ { id: 't3', title: 'Plan the next sprint', owner: 'Maya', state: 'todo', hours: 2 },
27
+ ]
28
+
29
+ const STATES = { todo: 'To do', doing: 'Doing', done: 'Done' }
30
+
31
+ const columns: ColumnDef<Task>[] = [
32
+ { id: 'title', header: 'Task' },
33
+ { id: 'owner', header: 'Owner' },
34
+ { id: 'state', header: 'State' },
35
+ { id: 'hours', header: 'Hours', format: 'integer', aggregate: 'sum' },
36
+ ]
37
+
38
+ const styles = `
39
+ .demo-cells-and-slots-slots .state {
40
+ text-align: center;
41
+ }
42
+
43
+ .demo-cells-and-slots-slots mark {
44
+ padding: 2px 8px;
45
+ border-radius: 999px;
46
+ background: #e4e4e7;
47
+ color: #18181b;
48
+ font-size: 13px;
49
+ }
50
+
51
+ .demo-cells-and-slots-slots mark[data-state='done'] {
52
+ background: #dcfce7;
53
+ color: #14532d;
54
+ }
55
+
56
+ .demo-cells-and-slots-slots mark[data-state='doing'] {
57
+ background: #e0e7ff;
58
+ color: #1e3a8a;
59
+ }
60
+ `
61
+
62
+ export default function Slots() {
63
+ return (
64
+ <div className="demo-cells-and-slots-slots">
65
+ <style>{styles}</style>
66
+ <Table
67
+ rows={tasks}
68
+ columns={columns}
69
+ aria-label="Tasks of the week"
70
+ cellAttrs={(cell) =>
71
+ cell.kind === 'cell' && cell.column.id === 'state' ? { className: 'state' } : undefined
72
+ }
73
+ slots={{
74
+ 'col-state': ({ row }) => <mark data-state={row.state}>{STATES[row.state]}</mark>,
75
+ 'header-hours': ({ label }) => `${label} (sum below)`,
76
+ 'foot-title': () => 'All tasks',
77
+ empty: () => 'No task this week.',
78
+ }}
79
+ />
80
+ </div>
81
+ )
82
+ }
83
+ ```
84
+
85
+ The State column shows a badge from its own slot. The Hours header has its own text, and the footer shows the sum under it.
86
+
87
+ ## The slots
88
+
89
+ | Content name | Fills | Gets |
90
+ | --- | --- | --- |
91
+ | `cell`, `col-{column id}` | A body cell | `row`, `node`, `column`, `value`, `text`, `format`, `selected`, `expanded`, `expandable`, `level`, `pinned`, `toggleSelected`, `toggleExpanded`, `formula` |
92
+ | `header`, `header-{column id}` | A header cell | `column`, `label`, `leaf`, `sort`, `sortIndex`, `toggleSort`, `pin`, `selectColumn`, `formula` |
93
+ | `foot`, `foot-{column id}` | A footer cell | `column`, `value`, `text`, `totals`, `aggregate`, `setAggregate` |
94
+ | `group` | The label cell of a group row | See [Groups and totals](./groups-and-totals.md) |
95
+ | `group-total`, `group-total-{column id}` | A cell of a group row under a column | See [Groups and totals](./groups-and-totals.md) |
96
+ | `detail` | The detail row of a row | `row`, `node`, `toggleExpanded` |
97
+ | `editor`, `edit-{column id}` | The editor of a cell | See [Editing](./cell-editing.md) |
98
+ | `empty` | The body, when no row passes the filters | Nothing |
99
+ | `loading` | The body, while `loading` is set and the table has no rows | Nothing |
100
+
101
+ A column-specific name wins over the general name: `col-state` wins over `cell`.
102
+
103
+ - `text` is the value with the format of the cell, else of its column. Show `text` unless the cell needs more.
104
+ - `row` is your own row object. `node` is the place of the row in the table: its `id`, its `depth` and its `parentId`.
105
+ - A header slot of a sortable column replaces the sort button too. Call `toggleSort(event)` from your own button, and pass the event: the table reads the Shift key from it.
106
+
107
+ ## Attributes of rows and cells
108
+
109
+ `rowAttrs`, `cellAttrs` and `sectionAttrs` give attributes to the elements that the table renders, such as a class or a `data-*` attribute of your own.
110
+
111
+ - `rowAttrs(context)` gets the kind of the row: `header`, `letters`, `row`, `group`, `detail`, `foot` or `empty`, with the row or the group.
112
+ - `cellAttrs(context)` gets the kind of the cell: `header`, `letter`, `cell`, `group`, `group-total`, `detail`, `foot` or `empty`, with the column and the row.
113
+ - `sectionAttrs` is an object with `head`, `body` and `foot`.
114
+
115
+ The table spreads these first and its own attributes after them. A caller cannot replace a part prop (`value`, `index`, `row`, `col`, `colspan`), a role, a `tabindex` or a state attribute of the table (`aria-*` and the `data-*` attributes of the table). Such a name in the answer is left out.
116
+
117
+ The table calls `rowAttrs` when it renders its rows, not for a new selection or a new active cell. Show such state with the attributes of the table, such as `aria-selected`. Pass the same function while its answers stay the same: a new function renders every row again.
118
+
119
+ ## Names
120
+
121
+ - **Attribute types:** `RowAttrsContext`, `CellAttrsContext`, `PartAttrs`.
122
+
123
+ For shared methods and result types, see [Controller](./reference-controller.md) and [View](./reference-view.md).
124
+
125
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
126
+
127
+ See the [More tiles of the sink](https://ui-sdk-table.fdts.dev/?page=sink&only=more).
@@ -0,0 +1,33 @@
1
+ # TableBody
2
+
3
+ Render the rows of the current view so the text on screen stays aligned with grid focus after sorting or filtering.
4
+
5
+ ## Composition
6
+
7
+ Place the body between the head and the optional foot. Render a [row](./component-row.md) for each ordinary entry in the displayed model; branch for groups or detail rows if you enable them. An empty message belongs in a plain row instead.
8
+
9
+ Import `TableBody` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableBody<Order>>{body => body.rows.map((flat, i) => (
13
+ <TableRow key={flat.id} value={flat.id} index={body.headerRowCount + i} />
14
+ ))}</TableBody>
15
+ ```
16
+
17
+ ## Inputs
18
+
19
+ No table-specific props. Body part state supplies `rows` (the flattened display entries) and `headerRowCount: number`. A data entry has `node.kind === 'row'` and carries the original object at `node.row`. Start body coordinates at `headerRowCount`, not at zero. A child renderer needs its own row type; it cannot infer that type from an ancestor.
20
+
21
+ ## Behavior and changes
22
+
23
+ The body binds pinning, sticky positioning and the row window. It has no selection or sort event of its own: the root changes the model, then you render the new order. When building a windowed body, use the window segments and [spacers](./component-spacer.md), not a loop over every source row.
24
+
25
+ ## Try it
26
+
27
+ [Jump to row 5,000 in the row window](./rows.md#the-row-window).
28
+
29
+ ## API
30
+
31
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
32
+
33
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,31 @@
1
+ # TableCell
2
+
3
+ Make one displayed value a focusable grid cell without writing navigation or selection handlers.
4
+
5
+ ## Composition
6
+
7
+ Put the cell in a row and supply its text or control as content. The coordinates connect it to the model; passing a number as `value` would not render that number. Render the [editor](./component-editor.md) in place of the value when the cell enters edit mode.
8
+
9
+ Import `TableCell` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableCell value={cellId} row={index} col={0}>{text}</TableCell>
13
+ ```
14
+
15
+ ## Inputs
16
+
17
+ `value: string` is a stable part key. `row: number` and `col: number` are zero-based grid positions, including header rows. Optional numeric `colspan` and `rowspan` describe a rectangle from that first position and otherwise act as one. Leave `header` unset for a data cell. Cell part state includes `editing`, `checking`, `error` and `fillHandle`.
18
+
19
+ ## Behavior and changes
20
+
21
+ The primitive gives the active cell `tabindex="0"` and handles focus, arrow keys and pointer presses. With the corresponding options on, it also handles range selection, clipboard events and starting an edit. Try F2 on an editable cell; an accepted save reports edits at the root rather than mutating the record. Native controls inside a cell keep their own input and clipboard behavior.
22
+
23
+ ## Try it
24
+
25
+ [Move between planets with the arrow keys](./table-components.md).
26
+
27
+ ## API
28
+
29
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
30
+
31
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,31 @@
1
+ # TableCol
2
+
3
+ Apply the model’s width to a column without rendering another header or data cell.
4
+
5
+ ## Composition
6
+
7
+ In a native table put one column part per visible leaf in a `colgroup` before the head, in display order. Its key follows the column when it moves. The part is not a `ColumnDef`: define the column and its width on the root first.
8
+
9
+ Import `TableCol` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <colgroup><TableCol value="price" /></colgroup>
13
+ ```
14
+
15
+ ## Inputs
16
+
17
+ `value: string` is the column id from the definitions. There is no width prop on this part. If the model has a width, the part exposes it as `--table-column-width` in pixels; otherwise it leaves the variable unset.
18
+
19
+ ## Behavior and changes
20
+
21
+ Use `[data-slot="table-col"] { width: var(--table-column-width); }` in a native table. A resize updates this column’s width; `data-column` identifies it and `data-pinned` identifies its pinned edge, if any. The part has no keyboard or pointer handlers. Put the interactive [resizer](./component-resizer.md) in the header cell instead.
22
+
23
+ ## Try it
24
+
25
+ [Drag a header edge, then move or pin its column](https://ui-sdk-table.fdts.dev/docs/column-definitions.md#width-order-and-pins).
26
+
27
+ ## API
28
+
29
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
30
+
31
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,31 @@
1
+ # TableEditError
2
+
3
+ Show the validation message where the open editor can name it as its error.
4
+
5
+ ## Composition
6
+
7
+ When the cell reports an `error`, put this part beside its editor inside the cell and render the message as its content. The part provides the association, not the error text or a second validation step.
8
+
9
+ Import `TableEditError` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableEditError value={cellId}>{error}</TableEditError>
13
+ ```
14
+
15
+ ## Inputs
16
+
17
+ `value: string` is the same `cellKey(rowId, columnId)` as the editor. It does not take an error string as `value`. Use the cell’s `error` for content; omit the part when there is no error.
18
+
19
+ ## Behavior and changes
20
+
21
+ The primitive generates an id for the message and sets `aria-errormessage` on the invalid editor to that id. Do not generate ids by hand. There is no error-part event to subscribe to: the column’s parser or schema refuses a value, and the cell reflects the refusal.
22
+
23
+ ## Try it
24
+
25
+ [Edit a price and try a value the column refuses](./cell-editing.md).
26
+
27
+ ## API
28
+
29
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
30
+
31
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,31 @@
1
+ # TableEditor
2
+
3
+ Give the active edit a text field that participates in validation, save, cancel and grid focus.
4
+
5
+ ## Composition
6
+
7
+ Render the editor inside its data cell only while that cell is editing. Use its sibling [error part](./component-edit-error.md) to display a refusal. The component part renders an input; for custom elements put a native `input` inside the editor tag.
8
+
9
+ Import `TableEditor` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableEditor value={cellKey(order.id, 'price')} />
13
+ ```
14
+
15
+ ## Inputs
16
+
17
+ `value: string` is the editing cell’s identity from `cellKey(rowId, columnId)` in `ui-sdk-table-core`. It is not the draft text. Let the behavior bind the input and initialize its contents. An eligible numeric field gets `inputmode="decimal"`, not `type="number"`.
18
+
19
+ ## Behavior and changes
20
+
21
+ The editor handles `keydown` and `focusout`. Enter requests a save; Escape cancels. A pending check makes the field read-only and `aria-busy`; a refusal keeps it open with `aria-invalid` and a link to the error. Handle the root’s cell-edit report to apply accepted changes to your rows.
22
+
23
+ ## Try it
24
+
25
+ [Edit a price and try a value the column refuses](./cell-editing.md).
26
+
27
+ ## API
28
+
29
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
30
+
31
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,31 @@
1
+ # TableFillHandle
2
+
3
+ Let a person drag from the corner of a selected range to fill neighbouring cells.
4
+
5
+ ## Composition
6
+
7
+ Inside the one cell whose `fillHandle` state is true, add the handle beside the displayed value. Give `[data-slot="table-fill-handle"]` a visible size and position in your stylesheet. Do not put a handle in every editable cell.
8
+
9
+ Import `TableFillHandle` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableFillHandle />
13
+ ```
14
+
15
+ ## Inputs
16
+
17
+ No table-specific props or cell id. The source is the current selection. Configure `fillHandle` on the root: `true`, `false`, `'vertical'` or `'horizontal'`. The `sheet` preset turns it on unless explicitly disabled.
18
+
19
+ ## Behavior and changes
20
+
21
+ A pointer press starts the fill, and the root tracks the drag even if the row window removes the original cell. The handle is hidden from assistive technology and adds no tab stop. Fill keys or `fillCells` provide alternatives. A successful multi-cell fill is one edit report and one history step when history is enabled; a refusal changes none of the cells.
22
+
23
+ ## Try it
24
+
25
+ [Drag the square to extend a series](./fill.md).
26
+
27
+ ## API
28
+
29
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
30
+
31
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,31 @@
1
+ # TableFoot
2
+
3
+ Group the footer rows without turning a total into a selectable data record.
4
+
5
+ ## Composition
6
+
7
+ Put the foot after the body. Inside it, render a [plain row](./component-plain-row.md) with `footer` set and cells for the totals you want to show. The foot does not calculate totals. Supply the totals from your data, or read them from a table controller with `getTotals`; do not sum just the rows currently mounted in the window.
8
+
9
+ Import `TableFoot` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableFoot><TablePlainRow footer index={footerIndex} /></TableFoot>
13
+ ```
14
+
15
+ ## Inputs
16
+
17
+ No table-specific props. The root owns aggregate definitions, any supplied totals, and `stickyFooter` (off by default). Footer position belongs on the row, not on this section.
18
+
19
+ ## Behavior and changes
20
+
21
+ The foot has role `rowgroup` and binds the pinning and sticky behaviors so footer cells can line up with body columns. The footer row, not the foot itself, is marked `data-sticky="bottom"` when it sticks. There is no footer change event.
22
+
23
+ ## Try it
24
+
25
+ [Compare the footer total with a group total](./groups-and-totals.md).
26
+
27
+ ## API
28
+
29
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
30
+
31
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,31 @@
1
+ # TableHead
2
+
3
+ Group the header rows so their cells can share the pinned-column offsets and sticky-row measurements.
4
+
5
+ ## Composition
6
+
7
+ Put the head before the body. Add one [header row](./component-header-row.md) for each level of headings, and one more above them if you render column letters. Put header cells inside those rows, not directly in the head.
8
+
9
+ Import `TableHead` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableHead><TableHeaderRow value="head" index={0} /></TableHead>
13
+ ```
14
+
15
+ ## Inputs
16
+
17
+ No table-specific props. The head neither takes a list of columns nor generates headings. The root options and column definitions determine the header model; your composition supplies its markup.
18
+
19
+ ## Behavior and changes
20
+
21
+ The head binds a `rowgroup` to the pinning and sticky-row behaviors. It does not sort, take focus or emit a header-click event. Enter to sort is handled by a sortable leaf header cell. Style the section with `[data-slot="table-head"]`.
22
+
23
+ ## Try it
24
+
25
+ [Scroll a table with sticky headings and totals](https://ui-sdk-table.fdts.dev/docs/styling.md).
26
+
27
+ ## API
28
+
29
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
30
+
31
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,31 @@
1
+ # TableHeaderCell
2
+
3
+ Render a heading that participates in grid focus, sorting and column operations.
4
+
5
+ ## Composition
6
+
7
+ Place a header cell inside a header row. It uses the same primitive slot as a [data cell](./component-cell.md). The component adapters render a `th`; the custom element uses the `header` property on the ordinary cell tag. Put the column label here, and a [resizer](./component-resizer.md) if this leaf column can resize.
8
+
9
+ Import `TableHeaderCell` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableHeaderCell value="head:price" header row={0} col={0}>Price</TableHeaderCell>
13
+ ```
14
+
15
+ ## Inputs
16
+
17
+ `value: string` identifies the part; key a heading by column id, never by visual position. `row: number` and `col: number` locate its first grid position (both start at zero). Set `header` to give the cell the `columnheader` role: choosing a `th` alone does not set that role. Optional numeric `colspan` and `rowspan` default to one. For a row-header column in the body, omit `header`.
18
+
19
+ ## Behavior and changes
20
+
21
+ Focus a sortable leaf heading and press Enter: the root requests a sort change, and `aria-sort` reflects the applied sort. The cell binds column reordering and pinning for a leaf, and Alt with a horizontal arrow resizes a resizable column. For pointer sorting, supply a control that calls `toggleSort`; the cell does not turn every click into a sort.
22
+
23
+ ## Try it
24
+
25
+ [Drag a header edge, then move or pin its column](https://ui-sdk-table.fdts.dev/docs/column-definitions.md#width-order-and-pins).
26
+
27
+ ## API
28
+
29
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
30
+
31
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,33 @@
1
+ # TableHeaderRow
2
+
3
+ Give a level of column headings its grid position and its own sticky-row identity.
4
+
5
+ ## Composition
6
+
7
+ Nest this row in the head and place [header cells](./component-header-cell.md) inside it. For a grouped header, render one row per level. A row of column letters, when enabled, comes before all other headings.
8
+
9
+ Import `TableHeaderRow` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableHeaderRow value="head" index={0}>
13
+ <TableHeaderCell value="head:price" header row={0} col={0}>Price</TableHeaderCell>
14
+ </TableHeaderRow>
15
+ ```
16
+
17
+ ## Inputs
18
+
19
+ `index: number` is the zero-based grid row. `value?: string` is the part key: give every header row a distinct, stable value even though the type permits omitting it. Otherwise multiple header rows share a part and only the last can stick.
20
+
21
+ ## Behavior and changes
22
+
23
+ The primitive supplies role `row` and `aria-rowindex` equal to `index + 1`. With `stickyHeader` on the root it measures this row and marks it `data-sticky="top"`; without it the row scrolls normally. There is no row selection, change callback or key handler on a header row.
24
+
25
+ ## Try it
26
+
27
+ [Scroll a table with sticky headings and totals](https://ui-sdk-table.fdts.dev/docs/styling.md).
28
+
29
+ ## API
30
+
31
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
32
+
33
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,31 @@
1
+ # TablePlainRow
2
+
3
+ Place an empty message or a footer in the grid without giving it a data-row id.
4
+
5
+ ## Composition
6
+
7
+ Use a plain row in the body when there are no records to show, or inside the foot to hold totals. Add the cells yourself. Use a [data row](./component-row.md) instead when a row should reflect record selection, expansion or pinning.
8
+
9
+ Import `TablePlainRow` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TablePlainRow index={1}><TableCell value="empty" row={1} col={0}>No orders</TableCell></TablePlainRow>
13
+ ```
14
+
15
+ ## Inputs
16
+
17
+ `index: number` is the zero-based grid position. Set `footer?: boolean` for a footer; leave it unset for an ordinary message row. There is no required `value` or record id.
18
+
19
+ ## Behavior and changes
20
+
21
+ The primitive supplies role `row` and sets `aria-rowindex` to `index + 1`. A footer gets `data-kind="footer"` and can stick to the bottom when the root has `stickyFooter`; a message row does not stick. There is no row-selection event or expandable state here.
22
+
23
+ ## Try it
24
+
25
+ [Scroll a table with sticky headings and totals](https://ui-sdk-table.fdts.dev/docs/styling.md).
26
+
27
+ ## API
28
+
29
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
30
+
31
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,33 @@
1
+ # TableResizer
2
+
3
+ Adjust one column’s width with a drag or the keyboard and report the final width separately from the drag steps.
4
+
5
+ ## Composition
6
+
7
+ Put the resizer at the edge of a resizable leaf header cell. Render it only where resizing is allowed by the root and column options. Style the handle’s hit area yourself; the headless part has no visible grip by default.
8
+
9
+ Import `TableResizer` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableHeaderCell header value="head:price" row={0} col={0}>
13
+ Price <TableResizer value="price" />
14
+ </TableHeaderCell>
15
+ ```
16
+
17
+ ## Inputs
18
+
19
+ `value: string` is the column id, not a pixel width. The root’s `columnWidths` and the column definition supply the width; minimum and maximum widths constrain it. Inspect `data-column` on the handle and `data-dragging` during a drag.
20
+
21
+ ## Behavior and changes
22
+
23
+ The part is a focusable vertical separator with an accessible name and current width. Drag with the primary pointer or focus the handle and press Left or Right; Shift takes a larger step. The handle keeps those arrow keys out of grid navigation. The root reports width changes during the gesture (`onColumnWidthsChange`) and reports its end separately (`onColumnWidthsCommit`), including after a keyboard step. On the custom element, listen for `columnwidthschange` and `columnwidthscommit` instead.
24
+
25
+ ## Try it
26
+
27
+ [Drag a header edge, then move or pin its column](https://ui-sdk-table.fdts.dev/docs/column-definitions.md#width-order-and-pins).
28
+
29
+ ## API
30
+
31
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
32
+
33
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,36 @@
1
+ # TableRoot
2
+
3
+ Connect rows and columns to one grid and supply the parts that render it.
4
+
5
+ ## Composition
6
+
7
+ Start here. Put a head and a body inside the root; add a column group or foot if you render widths or totals. Give the root an accessible name with `aria-label` or `aria-labelledby`. A root with data but no children does not generate a single cell.
8
+
9
+ Import `TableRoot` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableRoot aria-label="Orders" rows={orders} columns={columns}
13
+ selection="multiple" selected={selected} onSelectedChange={setSelected}>
14
+ <TableBody />
15
+ </TableRoot>
16
+ ```
17
+
18
+ For `orders: Order[]`, use `ColumnDef<Order>[]`. The generic root infers `Order`; pass the next selected ids to a React state setter.
19
+
20
+ ## Inputs
21
+
22
+ `rows?: readonly Row[]` and `columns?: readonly ColumnDef<Row>[]` describe the data. Omit them for an empty model. A row needs a stable `id` or a `getRowId` function. The other parts use these ids, not the source array indices. Options such as `selection` and `editable` belong here, not on each row or cell.
23
+
24
+ ## Behavior and changes
25
+
26
+ The root supplies the grid (or treegrid) role and row and column counts. It binds grid focus and tracks fill and pick drags that outlive a single cell. Keyboard navigation starts on the focused cell. Listen for state changes at the root: for example, selection is initially empty; `defaultSelected` sets a starting value, while `selected` is controlled by the owner.
27
+
28
+ ## Try it
29
+
30
+ [Move between planets with the arrow keys](./table-components.md).
31
+
32
+ ## API
33
+
34
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
35
+
36
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,33 @@
1
+ # TableRow
2
+
3
+ Keep a visible row attached to the same record when the model changes order.
4
+
5
+ ## Composition
6
+
7
+ Render a row inside the body, then add one cell per visible column for an ordinary data row. Use a [plain row](./component-plain-row.md) for a footer or empty message; neither represents a record.
8
+
9
+ Import `TableRow` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableRow key={flat.id} value={flat.id} index={index}>
13
+ <TableCell value={cellId} row={index} col={0}>{text}</TableCell>
14
+ </TableRow>
15
+ ```
16
+
17
+ ## Inputs
18
+
19
+ `value: string` is the displayed entry’s stable id, not a DOM `id`. `index: number` is its current zero-based grid position, including header rows. When a row moves, keep `value` and update `index`. Row part state exposes `selected`, `expanded`, `expandable` and the zero-based `level`.
20
+
21
+ ## Behavior and changes
22
+
23
+ The row exposes `aria-rowindex`, selection and expansion where applicable, and tree position for tree rows. It binds row measurement and sticky positioning for pinned rows. To select with the keyboard, focus a cell and press Space with selection enabled. The cell handles the key and the root reports the new ids; there is no row-level selection callback.
24
+
25
+ ## Try it
26
+
27
+ [Select rows and inspect the selected ids](./selection-and-keyboard.md).
28
+
29
+ ## API
30
+
31
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
32
+
33
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).
@@ -0,0 +1,31 @@
1
+ # TableSpacer
2
+
3
+ Reserve the height of rows that a windowed body has not mounted.
4
+
5
+ ## Composition
6
+
7
+ Insert a spacer in the body wherever the row window leaves a gap. Keep the leading spacer in place even when its size is zero: it marks where the row list begins for scroll measurements.
8
+
9
+ Import `TableSpacer` and its surrounding parts from `ui-sdk-table-react`. See the [React guide](./react.md) for the complete setup.
10
+
11
+ ```tsx
12
+ <TableSpacer value="gap-0" size={gapHeight} />
13
+ ```
14
+
15
+ ## Inputs
16
+
17
+ `value: string` identifies the gap. Use `gap-0` for the first one: the row-window behavior binds its origin to that key. `size: number` is the gap height in pixels, not a count of rows or a grid index.
18
+
19
+ ## Behavior and changes
20
+
21
+ Use `--table-spacer-size` in your CSS to give the gap its measured height. A zero-height gap gets `data-empty`; every spacer is `aria-hidden="true"`. It is not a data row, a focus target or a source of selection events. `rowWindow` is off by default on the root.
22
+
23
+ ## Try it
24
+
25
+ [Jump to row 5,000 in the row window](./rows.md#the-row-window).
26
+
27
+ ## API
28
+
29
+ See the [table components overview](./table-components.md) for how the parts fit together. For all imports, types and signatures in your renderer:
30
+
31
+ For props, callbacks and render functions, see the [React API reference](./api-react.md).