Talisman LogoTalisman Logo Design System
Browse documentation
Components

Table skeleton

A loading placeholder for tables that keeps the real headers and column count, so the layout does not shift when rows arrive.

Stableimport { TableSkeleton } from "@repo/ui/table-skeleton";Source
Número do processoTarefaRevisorStatusPrazo

The table renders its own structure with skeleton cells. Headers you pass stay readable while the rows load.

When to use

  • While the rows of a list page load for the first time, such as the task catalog in the admin.
  • When the column count is known before the data arrives, so the table does not change shape afterwards.
  • When filters or a page change replace all rows and the wait can be noticed (the manifesto asks for feedback within 400ms).

When not to use

  • Non-tabular content. Use Skeleton and its groups.
  • A short refresh of rows already on screen. Keep the rows and show a small Loader.
  • A wait with no table in sight, such as a save. Use Loader.
  • No rows to show. Show an empty state, not a skeleton.

Examples

Without headers

Leave headers out when the column titles are not known yet. The header row loads too.

Limited height

Set maxHeight to keep a long placeholder inside the page. The container scrolls.

Número do processoTarefaRevisorStatusPrazo
TarefaRevisorStatus
<TableSkeleton />

Content

  • Pass the same header labels as the real table, in the same order and language: “Número do processo”, “Tarefa”, “Revisor”.
  • Set columnCount to the number of real columns, and rowCount close to the usual page size.
  • Do not put text in cells: all data cells are skeletons.

Accessibility

  • The component is a real table, so the header cells are th elements and keep their names when you pass headers.
  • The skeleton cells are empty div elements with no role or label. Nothing announces that the table is loading: set aria-busy="true" on the region that wraps it.
  • The shimmer is disabled when the user prefers reduced motion.

Code

import { TableSkeleton } from "@repo/ui/table-skeleton";

<TableSkeleton
  columnCount={5}
  headers={["Número do processo", "Tarefa", "Revisor", "Status", "Prazo"]}
  rowCount={10}
/>;

Props

PropTypeDefaultDescription
cellClassNamestring—Extra classes for each skeleton cell, to change its width
classNamestring—Extra classes for the scroll container
columnCountnumber—Number of columns
data-testidstringtable-skeletonTest id on the container
headersstring[]—Column titles. A column without a title gets a skeleton bar in its header
maxHeightstring—Maximum height of the container, as a CSS length
rowCountnumber5Number of rows

Known issues

Issue Effect
The container always has id="table-container", and the real Table container has it too. Two skeleton tables on one page, or a skeleton next to a real table, produce duplicate ids and invalid HTML.
Every data cell is w-[200px] unless cellClassName is passed. With many columns the table is wider than a narrow container and scrolls sideways.
No aria-busy, role or label. Screen reader users are not told the table is loading.
Edit this page on GitHub