You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/app-shell/components/data-table.md
+31-15Lines changed: 31 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,7 +225,7 @@ A column definition passed to `useDataTable`. `Column<TRow>` is a discriminated
225
225
|`width`|`number`| Fixed column width in pixels. Optional. |
226
226
|`align`|`"left" \| "right"`| Horizontal alignment. Defaults to `"right"` for `type: "number"` and `type: "money"`; `"left"` otherwise. Pass `"left"` to opt a numeric column out. |
227
227
|`truncate`|`boolean`| Truncate overflowing text with an ellipsis. Wires up an app-shell `<Tooltip>` automatically when the resolved cell value is a string or number — resolved via `accessor` first, then `row[col.id]` as a fallback — so hovering the cell reveals the full value. With `inferColumns`, no explicit `accessor` is needed because `id` is pinned to the field name. Requires another column to anchor the row width (`width` on a neighbor, or a fixed-size column like selection / row actions). |
228
-
|`accessor`|_(narrowed per `type`)_| Extracts the raw value. The return type is narrowed per `type` branch — returning an array or a plain object is a compile error on a typed column. Untyped columns (`type` omitted) retain `unknown`. `null` and `undefined` are always allowed.|
228
+
|`accessor`|_(narrowed per `type`)_| Extracts the raw value. The return type is narrowed per `type` branch — returning an array is a compile error on all typed columns except `badge`, and returning a plain object is a compile error on all typed columns. Untyped columns (`type` omitted) retain `unknown`. `null` and `undefined` are always allowed. |
229
229
|`sort`|`SortConfig`| Sort configuration. When set, the column header becomes clickable (Asc → Desc → off). |
230
230
|`filter`|`FilterConfig`| Filter configuration. When set, the column appears as an option in `DataTable.Filters`. |
231
231
@@ -254,14 +254,14 @@ column({
254
254
});
255
255
```
256
256
257
-
|`type`| Accessor return type | Value handling | Options interface |
`inferColumns` (from `@tailor-platform/app-shell-sdk-plugin`) derives `label`, `sort`, `filter`, and a default `render` from TailorDB metadata. You can layer a `type` on top to swap the rendering without losing the inferred sort/filter config:
447
+
`inferColumns` (from `@tailor-platform/app-shell-sdk-plugin`) derives `label`, `sort`, `filter`, and `id` from TailorDB metadata. You can layer a `type` on top to get a built-in renderer without losing the inferred sort/filter config:
432
448
433
449
```tsx
434
450
const infer =inferColumns(tableMetadata.order);
435
451
436
452
const columns = [
437
-
// Inferred string column — keeps the default render
453
+
// Inferred column — displays row[id] as plain text
438
454
column(infer("reference")),
439
455
440
456
// Inferred datetime column, swapped to a `date` cell with long format
@@ -457,7 +473,7 @@ const columns = [
457
473
];
458
474
```
459
475
460
-
When you spread `...infer("field")`, drop in `accessor`if the inferred render doesn't already match what your `type` expects — built-in renderers read from `accessor` (or `row[id]`), not from the inferred `render`.
476
+
When you spread `...infer("field")`, add `accessor`when you want a typed renderer to read a specific value — built-in renderers read from `accessor` (or `row[id]`).
Copy file name to clipboardExpand all lines: docs/app-shell/components/description-card.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ Plain text display with optional truncation and copy button.
67
67
68
68
### badge
69
69
70
-
Displays value as a Badge component with variant mapping.
70
+
Displays value as a Badge component with variant mapping. Accepts a single value or an array of values.
71
71
72
72
```tsx
73
73
{
@@ -89,6 +89,27 @@ Displays value as a Badge component with variant mapping.
89
89
90
90
Badge values are rendered in sentence case by default. Set `meta.sentenceCaseBadges` to `false` when you need to display the original value from your data.
91
91
92
+
#### Array badges with overflow
93
+
94
+
When the field value is an array, each item is rendered as a separate badge. Use `maxVisible` to cap the number shown — extra items appear in a hover popover:
0 commit comments