Feedback Core Stable

Skeleton

Placeholder bones — a block, one or more text lines, or a circular avatar — with a phase-synced shimmer sweep or opacity pulse, that swaps to real content once loading finishes while keeping aria-busy semantics correct throughout

Preview

Installation

pnpm add fancy-ui-svelte
import { Skeleton } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { Skeleton } from 'fancy-ui-svelte';
</script>

<Skeleton />

Examples

Basic Usage

Variants

Rect, text, and circle bones across all three animations.

With Children

Wrapping mode: real content swaps in once loading is false.

Props

PropTypeDefaultDescription
variant "rect" | "text" | "circle""rect"Bone shape: a block, one or more text lines, or a circular avatar
lines number1Number of text lines to render; only read when variant is "text". The last line renders at 60% width so a paragraph placeholder doesn't read as a perfect rectangle
animation "shimmer" | "pulse" | "none""shimmer"Shimmer sweep, opacity pulse, or a static muted bone (still a valid loading cue on its own)
loading booleantrueWhether the placeholder is currently showing. In wrapping mode (children supplied) drives the swap to real content; in standalone mode drives whether anything renders at all
label string"Loading"The one screen-reader announcement. Pass "" to silence it entirely
class string-Additional CSS classes; also the sizing hook, since rect/text bones have no intrinsic size
ref HTMLDivElement | nullnullBindable reference to the root element; null whenever nothing is rendered

Slots

SlotDescription
childrenReal content to reveal once loading is false. Its mere presence (not its value) switches Skeleton from standalone to wrapping mode