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 processo
Tarefa
Revisor
Status
Prazo
Tarefa
Revisor
Status
<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
Prop
Type
Default
Description
cellClassName
string
—
Extra classes for each skeleton cell, to change its width
className
string
—
Extra classes for the scroll container
columnCount
number
—
Number of columns
data-testid
string
table-skeleton
Test id on the container
headers
string[]
—
Column titles. A column without a title gets a skeleton bar in its header
maxHeight
string
—
Maximum height of the container, as a CSS length
rowCount
number
5
Number 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.