Skip to content

Skeleton

A loading placeholder that mirrors the shape of content while it loads.

<script>
import Skeleton from "@invisible-ui/svelte/Skeleton.svelte";
</script>

In Elements:

<ds-skeleton variant="circle"></ds-skeleton>
<ds-skeleton lines="3" label="Loading profile"></ds-skeleton>
PropTypeDefaultDescription
variant"text" | "circle" | "rect""text"Shape.
linesnumber1Lines for the text variant (last line shortened).
widthstring | undefinedundefinedAny CSS length (circle uses width for both).
heightstring | undefinedundefinedAny CSS length (circle uses width for both).
radiusstring | undefinedundefinedBorder-radius override.
animation"pulse" | "wave" | "none""pulse"Shimmer style.
labelstring | undefinedundefinedWhen set, becomes a polite role="status".
  • Decorative by default (aria-hidden) — announce loading on the surrounding region. Pass label to make the skeleton itself a polite status. Respects prefers-reduced-motion.
<Skeleton variant="circle" width="3rem" />
<Skeleton variant="text" lines={3} />

In React:

<Skeleton variant="circle" width="3rem" />
<Skeleton variant="text" lines={3} label="Loading profile" />

Themeable via --ds-skeleton-*.