Talisman LogoTalisman Logo Design System
Browse documentation
Components

Skeleton

A shimmering placeholder that mirrors the shape of content while it loads, so the page does not jump when data arrives.

Stableimport { Skeleton } from "@repo/ui/skeleton";Source

Compose Skeleton blocks into the layout of the content they replace, or use SkeletonGroup for the common layouts.

When to use

  • When a page, a card or a list loads and you know what it will look like: lines of text, an avatar, a table.
  • When the wait is longer than a blink. The manifesto asks for feedback within 400ms: a skeleton is that feedback, and it keeps the layout still when the data arrives.
  • For a first load. For a refresh of content already on the page, keep the old content and show a small Loader.

When not to use

  • A wait with no known shape. A save in progress, an upload or a background job: use Loader.
  • A task with a known percentage. Use Progress.
  • A table that is loading. Use Table skeleton, which keeps the real headers and column count.
  • A button waiting for a request. Use the isLoading prop of Button.
  • Empty or failed content. Show an empty state or an inline error. A skeleton that never ends looks like a hung page.

Skeleton or spinner

Situation Use
Content with a known layout loads Skeleton
Short action with unknown result (save, send) Loader
Refresh of content that is already visible Loader
Several seconds of work with measurable steps Progress

A skeleton shows where things will be. A spinner only says that something is happening. Prefer the skeleton whenever you can draw the final layout, and never show both for the same area.

Shapes

Skeleton is a block with rounded corners. Set its size and shape with className: height and width for lines, rounded-full for avatars.

Groups

SkeletonGroup renders a preset layout. Pick the one closest to the final content and set count from 1 to 4.

Type Use for
card-section A header and a row of cards.
paragraph-list A header and titled paragraphs.
table-rows A header row and rows of five columns.
avatar-list A list of people with name and details.
avatar-section A header and a row of people.
count
type
<SkeletonGroup type="paragraph-list" />

Content

  • A skeleton holds no text. Do not write “Carregando…” inside it.
  • Match the final layout: same number of lines, same heights, same alignment.
  • Do not mix a skeleton and real content in the same block. Replace the whole block at once.

Do and don’t

DoDraw the same lines the content will have.
Don'tDon't use one big block. The layout still jumps when the content arrives.

Accessibility

  • A skeleton is a plain div with no role and no text. Assistive technology reads nothing, so the loading state is silent.
  • Announce the wait from the container: set aria-busy="true" on the region that loads and remove it when the data arrives, or add a visually hidden status message.
  • The shimmer stops when the user asks for reduced motion (prefers-reduced-motion: reduce): the block becomes a solid surface.
  • Skeletons are not focusable and carry no interaction.

Code

import { Skeleton, SkeletonGroup } from "@repo/ui/skeleton";

<div aria-busy="true" className="flex flex-col gap-3">
  <Skeleton className="h-5 w-40" />
  <Skeleton className="h-3 w-full" />
  <Skeleton className="h-3 w-4/5" />
</div>;

<SkeletonGroup count={3} type="card-section" />;

Props

Skeleton
PropTypeDefaultDescription
classNamestring—Size and shape of the block (height, width, rounded corners). The shimmer and the base radius (4px) come from the component.
...propsReact.HTMLAttributes<HTMLDivElement>—Any other `div` attribute, such as `aria-hidden`.
SkeletonGroup
PropTypeDefaultDescription
classNamestring—Extra classes for the wrapper, for spacing and layout only
count"1" | "2" | "3" | "4"1How many items the layout repeats
type"avatar-list" | "avatar-section" | "card-section" | "paragraph-list" | "table-rows"—Preset layout to render

Known issues

Issue Effect
Neither Skeleton nor SkeletonGroup sets aria-busy, a role or a label. Screen reader users get no sign that content is loading. Each caller has to add it.
SkeletonGroup presets use fixed pixel widths (w-[103px], w-[240px], w-[210px]) for some bars. They do not follow the container width, so on narrow panels they can overflow or look short.
table-rows always renders five columns, and card-section puts all cards in one row. They cannot match a table with another column count. Use Table skeleton for tables.
Edit this page on GitHub