Skeleton Component — Astro

Accessible loading placeholder with shimmer animation

Skeleton Component

A loading placeholder that shows a shimmer animation while content is loading. Uses role="status" and aria-label (default: "Loading") for screen readers. Respects prefers-reduced-motion.

Add this component

Run the command below in your project directory. When prompted, select the component(s) you want. The CLI will copy the CSS and component files.

Choose your package manager — click a tab to select, then copy the command.

npm pnpm yarn bun

Props

  • variant (string, optional) - text, circle, rect, default (default: default)
  • label (string, optional) - Accessible label for screen readers (default: "Loading")
  • class (string, optional) - Additional CSS classes

Basic Usage

Live Example

Usage

Full example for each framework (Astro, Vanilla, Svelte, Vue, React). Switch framework via View as or by clicking a Usage tab—both stay in sync.

Astro Vanilla Svelte Vue React

Variants

Live Example
astro astro
<Skeleton variant="text" />
<Skeleton variant="circle" />
<Skeleton variant="rect" />

Accessibility

  • role="status" and aria-label so screen readers announce loading state
  • Shimmer animation disabled when user prefers reduced motion

Other frameworks: Vanilla · Svelte · Vue · React