Skip to content
HomeCobalt

Skeleton

Holds the place of content that is still on its way, so the page does not jump when it arrives.

Examples

The list's first load: the bars stay clear for 250ms, so a quick answer shows none, then hold the rows' own boxes until the rows fade in.

Largest funds

PicturesA list's first load with a block the size and corner of each avatar, beside a line where each name will go.
In a cardA card's first load, then its facts at the same size; the terms are known at once, so only the values wait.
Net assets
Expense ratio
Holdings

Usage

Use it when

  • The text's shape is known and the answer takes longer than the slow-wait delay, so the bars promise what arrives.
  • A picture, a chart or an avatar has a known size, and a block holds its place.
  • A Suspense boundary waits on a module whose rendered size is known.

Use something else when

  • The wait may be under 250ms. Use useSlowWait instead, which keeps the previous content until the wait is worth admitting to.
  • The content is already on screen and a reload, a page turn or a filter replaces it. Use ListBody instead, which keeps it on screen, dimmed, until the answer lands.
  • The answer is known to be none. Use Empty instead.
  • A control is waiting on its own action. Use StateButton instead.
  • The shape of the answer is not known. Use Spinner instead.

Rules

General

Avoid

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/skeleton.json
import { Skeleton } from "@/components/cobalt/ui/skeleton"