Skip to content

Skeleton

A placeholder block for content that is loading.

import { Skeleton } from '@/design-system';

Examples

Shape each block with classes.

Loading customers

import { Skeleton } from '@/design-system';

export default function SkeletonBasic() {
  return (
    <div className="space-y-2">
      <p role="status" className="text-sm text-muted">
        Loading customers
      </p>
      <Skeleton className="h-11" />
      <Skeleton className="h-11" />
      <Skeleton className="h-11 w-2/3" />
    </div>
  );
}

How it works

  • It is hidden from screen readers. Announce the loading in text nearby.
  • It pulses, except for people who ask for reduced motion.

Props

Skeleton takes only this prop.

Skeleton props
PropTypeDefaultDescription
classNamestring—Sets the size. Without a height the block cannot be seen.

Tokens

Tokens
TokenDefaultSets
--skeleton-radius0.375remCorner radius
--skeleton-background--borderFill