feat(ui): export TableBodySkeleton as public API (#33731)

* feat(ui): export TableBodySkeleton as public API

Export the TableBodySkeleton component so it can be used independently
of the built-in Table component. Relax the column type constraint from
ColumnConfig<T> to { id: string } for compatibility with custom column
types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Jonathan Roebuck <jroebuck@spotify.com>

* fix(ui): use direct index instead of parsing skeleton item ID

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Jonathan Roebuck <jroebuck@spotify.com>

* Update .changeset/export-table-body-skeleton.md

Co-authored-by: Johan Persson <johanopersson@gmail.com>
Signed-off-by: Jonathan Roebuck <jroebuck@spotify.com>

* docs(ui): add TableBodySkeleton to table primitives documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Jonathan Roebuck <jroebuck@spotify.com>

---------

Signed-off-by: Jonathan Roebuck <jroebuck@spotify.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
Jonathan Roebuck
2026-04-08 10:21:17 +01:00
committed by GitHub
parent 1e97694b15
commit f73876a472
6 changed files with 43 additions and 5 deletions
@@ -24,6 +24,7 @@ import {
tableRootPropDefs,
columnPropDefs,
rowPropDefs,
tableBodySkeletonPropDefs,
} from './props-definition';
import {
tableUsageSnippet,
@@ -303,6 +304,12 @@ Low-level components for building custom table layouts.
<ReactAriaLink component="Cell" href={reactAriaUrls.cell} />
#### TableBodySkeleton
A table body that renders animated skeleton rows as a loading placeholder. Useful when composing with primitives and you need a loading state without the full `Table` component.
<PropsTable data={tableBodySkeletonPropDefs} />
<Theming definition={TableDefinition} />
<ChangelogComponent
@@ -317,5 +324,6 @@ Low-level components for building custom table layouts.
'cell',
'cell-text',
'cell-profile',
'table-body-skeleton',
]}
/>
@@ -491,6 +491,15 @@ export const columnPropDefs: Record<string, PropDef> = {
},
};
export const tableBodySkeletonPropDefs: Record<string, PropDef> = {
columns: {
type: 'enum',
values: ['{ id: string }[]'],
description:
'Array of column objects. Each item must have an `id` property. Compatible with `ColumnConfig` and custom column types.',
},
};
export const rowPropDefs: Record<string, PropDef> = {
id: {
type: 'enum',