Skeleton table

The skeleton table component is used to display placeholder "skeletons" within a table as its contents load.

Examples

Basic skeleton table

To indicate that a table's cells are still loading, a basic skeleton table uses the skeleton component to place a placeholder skeleton in each cell. Once the data is loaded, the skeleton table is replaced with a table containing the real data.

FirstSecond

Compact skeleton table

The skeleton table can be displayed as a compact table by setting the variant prop to compact. Borders can be toggled off by setting borders to false.

FirstSecond

Selectable columns

The skeleton table can display selectable columns by setting the isSelectable prop to true. The selectVariant prop determines if radio buttons or checkboxes are used.

Data selection table header cellFirstSecond

Expandable rows

The skeleton table can display the indicator for expandable rows by setting the isExpandable prop to true.

Data expansion table header cellFirstSecond

Customizable column headers

Custom column headers can be provided by passing an array of strings or Th components to the columns prop instead of an array of strings. This allows you to support sorting on columns, add custom content, or style the column headers.

Full loading simulation

The following example demonstrates the typical behavior of a skeleton table transitioning to a normal table as the data becomes available.

To simulate this loading process, click the "Reload table" button and wait for the data to populate.

RepositoriesBranchesPull requestsWorkspacesLast commit

Skeleton table head

You can render only the <Thead> part of the skeleton table by using the <SkeletonTableHead/>.

FirstSecond

Skeleton table body

You can also render only the <Tbody> part of the skeleton table by using the <SkeletonTableBody/>.

Props

SkeletonTable

extends TableProps
*required
NameTypeDefaultDescription
bordersbooleantrueFlag indicating if the table should have borders
captionReact.ReactNodeAny captions that should be added to the table
columns(ReactNode | { cell: ReactNode; props?: ThProps })[]Custom columns for the table
columnsCountnumberNumber of columns in the table
isExpandablebooleanFlag indicating if the table is expandable
isSelectablebooleanFlag indicating if the table is selectable
ouiaIdstring | number'SkeletonTable'Custom OUIA ID
rowsCountnumber5The number of rows the skeleton table should contain
selectVariantRowSelectVariantRowSelectVariant.checkboxDetermines if the row selection variant (radio/checkbox)
variantTableVariantIndicates the table variant

SkeletonTableHead

*required
NameTypeDefaultDescription
columns(ReactNode | { cell: ReactNode; props?: ThProps })[]Custom columns for the table
columnsCountnumberNumber of columns in the table
isExpandablebooleanFlag indicating if the table is expandable
isSelectablebooleanFlag indicating if the table is selectable
isTreeTablebooleanFlag indicating if the table is a tree table
ouiaIdstring | number'SkeletonTableHeader'Custom OUIA ID

SkeletonTableBody

*required
NameTypeDefaultDescription
columnsCountrequirednumberNumber of columns in the table
isExpandablebooleanFlag indicating if the table is expandable
isSelectablebooleanFlag indicating if the table is selectable
ouiaIdstring | number'SkeletonTableBody'Custom OUIA ID
rowsCountnumber5Number of rows in the table
selectVariantRowSelectVariantRowSelectVariant.checkboxDetermines if the row selection variant (radio/checkbox)