antlitz
Menu

Skeleton

A placeholder for content that has not loaded.

import { Skeleton } from "antlitz";

API

Skeleton adds no props of its own — every prop is forwarded to the underlying element.

It is aria-hidden, so assistive technology skips it entirely. Announce the loading state with a live region or a Spinner if the wait is long enough to need one.

Usage

export function Loading() {
  return (
    <Card className="flex w-full max-w-xs flex-col gap-3">
      <Skeleton className="h-4 w-2/3" />
      <Skeleton className="h-3" />
      <Skeleton className="h-3 w-4/5" />
    </Card>
  );
}

Skeleton is a full-width pulsing block with no height of its own. Give it the shape of the content it stands in for.

The pulse keeps running under reduced motion. It changes opacity, not position, so there is no movement for the preference to suppress.

Shapes

export function Shapes() {
  return (
    <>
      <Skeleton className="size-10 rounded-full" />
      <Skeleton className="h-10 w-24" />
      <Skeleton className="h-24 w-40" />
    </>
  );
}