SkeletonTable
Feedback

SkeletonTable

Displays placeholder rows with Table cell padding, borders, and header styling.

Props

SkeletonTable extends HTMLAttributes<HTMLDivElement>.

SkeletonTableProps props
PropTypeDefaultDescription
rowsnumber5How many body rows to draw.
columnsnumber | CSSProperties['width'][]4Column count or array of column widths.
headerbooleantrueDraws the header band above the rows.
animationSkeletonAnimation"shimmer""shimmer" | "pulse" | "none".

Examples

Default

SkeletonTable

Column widths

SkeletonTable with widths

Headerless

Drop the band when the real table's header is already rendered: the columns are known before the rows are, and re-drawing the header as a placeholder makes the page flash.

SkeletonTable (no header)
ImportTSX
import { SkeletonTable } from "@solarius/onset";

{
  loading ? (
    <SkeletonTable rows={8} columns={["20%", "45%", "30%", "25%"]} />
  ) : (
    <Table>…</Table>
  );
}

On a re-fetch of a table already on screen, use LoadingOverlay instead; it keeps the rows and the reader's scroll position.