Skeleton
A loading placeholder that mirrors the shape of content while it loads.
Import
Section titled “Import”<script> import Skeleton from "@invisible-ui/svelte/Skeleton.svelte";</script><script setup> import { Skeleton } from "@invisible-ui/vue";</script>import { Skeleton } from "@invisible-ui/react";<script type="module"> import "@invisible-ui/elements/define";</script>
<ds-skeleton></ds-skeleton>In Elements:
<ds-skeleton variant="circle"></ds-skeleton><ds-skeleton lines="3" label="Loading profile"></ds-skeleton>| Prop | Type | Default | Description |
|---|---|---|---|
variant | "text" | "circle" | "rect" | "text" | Shape. |
lines | number | 1 | Lines for the text variant (last line shortened). |
width | string | undefined | undefined | Any CSS length (circle uses width for both). |
height | string | undefined | undefined | Any CSS length (circle uses width for both). |
radius | string | undefined | undefined | Border-radius override. |
animation | "pulse" | "wave" | "none" | "pulse" | Shimmer style. |
label | string | undefined | undefined | When set, becomes a polite role="status". |
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "text" | "circle" | "rect" | "text" | |
lines | number | 1 | Number of lines for the text variant. |
width | string | undefined | Any CSS length (e.g. "12rem", "100%"). For circle, also sets height. |
height | string | undefined | Any CSS length. Ignored by text (uses line height). |
radius | string | undefined | Border radius override (any CSS length). |
animation | "pulse" | "wave" | "none" | "pulse" | Shimmer animation. Defaults to pulse. |
label | string | undefined | When set, the skeleton becomes a polite status with this accessible name. |
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "text" | "circle" | "rect" | "text" | |
lines | number | 1 | Number of lines for the text variant. |
width | string | — | Any CSS length, such as "12rem" or "100%". For circle, also the height. |
height | string | — | Any CSS length. The text variant follows the line height instead. |
radius | string | — | Border radius override (any CSS length). |
animation | "pulse" | "wave" | "none" | "pulse" | Shimmer animation. Defaults to pulse. |
label | string | — | When set, the skeleton becomes a polite status with this accessible name. |
| Attribute | Reactive | Description |
|---|---|---|
variant | yes | text|circle|rect |
lines | yes | the text lines; 1 by default |
width | yes | a CSS length; for circle, the height too |
height | yes | a CSS length; text follows the line height |
radius | yes | a CSS length |
animation | yes | pulse|wave|none |
label | yes | turns the skeleton into a named status |
Reactive attributes re-render the element when they change after the first render.
Accessibility
Section titled “Accessibility”- Decorative by default (
aria-hidden) — announce loading on the surrounding region. Passlabelto make the skeleton itself a polite status. Respectsprefers-reduced-motion.
Example
Section titled “Example”<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-*.