Table skeleton
skeleton-table is a set of five decorative loading placeholders for tabular content: rows, columns, a bordered grid, a grid with a header row, and a dense compact list. Each variant shares one calm token-colored pulse and stops animating under reduced motion.


Installed with shadcn add · 2 workarounds · theme from registry.json
- applied the registry's theme (tokens, fonts and CSS from the registry preview settings)
- installed base item https://ai2.design/r/tokens.json (registry preview settings)
Installation
Requires @ai2 in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import * as React from "react"import { RowsSkeleton } from "@/components/ui/skeleton-table"export function Loading() { return <RowsSkeleton size="md" count={5} />}- Show while tabular data (tables, data grids, lists of records) is fetching, so the layout does not shift when content arrives.
- Pick RowsSkeleton for simple lists, ColumnsSkeleton for multi-column card layouts, TableGridSkeleton for a body-only table, HeaderSkeleton when the real table has a header row, and CompactSkeleton for narrow side panels.
- Use it inside an ai2-styled page so the tokens (secondary, muted, border, card) match the surrounding UI.
- Avoid it for content that is not tabular; use a plain skeleton or spinner instead.
Examples
Loading a list of orders
RowsSkeleton with a larger size and six rows while an order list loads.
import * as React from "react"import { RowsSkeleton } from "@/components/ui/skeleton-table"export function OrdersLoading() { return <RowsSkeleton size="lg" count={6} />}Users table with a header
HeaderSkeleton shows a muted header row above five body rows, matching a real table with a header.
import * as React from "react"import { HeaderSkeleton } from "@/components/ui/skeleton-table"export function UsersTableLoading() { return <HeaderSkeleton size="md" rows={5} className="max-w-2xl" />}Compact sidebar list
CompactSkeleton renders frameless dense rows for a narrow side panel.
import * as React from "react"import { CompactSkeleton } from "@/components/ui/skeleton-table"export function SidebarLoading() { return <CompactSkeleton size="sm" count={4} />}Swapping skeleton for real content
Shows a TableGridSkeleton while loading and the real table once data is ready, with a screen-reader status message.
import type * as React from "react"import { TableGridSkeleton } from "@/components/ui/skeleton-table"export function TableWithStatus({ loading, children }: { loading: boolean; children: React.ReactNode }) { return ( <div role="status" aria-busy={loading}> {loading ? <TableGridSkeleton size="xl" rows={6} /> : children} {loading ? <span className="sr-only">Loading</span> : null} </div> )}API reference
Accessibility
- The root element of every variant has aria-hidden="true", so screen readers skip the decorative blocks entirely.
- Because the skeleton is hidden, announce loading separately, for example with role="status" and aria-busy on a wrapper plus visually hidden text, as shown in the examples.
- The pulse is removed when the user prefers reduced motion (useReducedMotion from motion/react), leaving static blocks.
- Colour comes only from ai2 design tokens (secondary, muted, border, card), which keeps contrast consistent with the active theme.
- Cell widths are picked deterministically by index, so server and client render identical markup and there is no hydration mismatch.
Docs written by anthropic:claude-haiku-5-5 from the registry source.
Use with Coding Agent
Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.
Use the "Table skeleton" component (ai2/skeleton-table) from its shadcn registry.1. Install it with: npx shadcn@latest add @ai2/skeleton-table2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, className, count, rows, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport * as React from "react"import { RowsSkeleton } from "@/components/ui/skeleton-table"export function Loading() { return <RowsSkeleton size="md" count={5} />}```Files & dependencies
- registry/ai2/styled/skeleton-table.tsx→ components/ui/skeleton-table.tsx