Skip to main content
Urbicon UI

Skeleton

Placeholder loading animations that mimic content layout.

Playground

Loading…
Variant
Animation
Count
<Skeleton
  count="1"
  height=""
  width=""
/>

01 Examples

You render a Skeleton while the data loads and swap in the real content once it arrives, with a plain Svelte if-block around the two. variant picks the shape, count repeats lines, and size or an explicit width/height set the dimensions. animation runs a fade (pulse), a shimmer (wave), or nothing (none).

Text Placeholder

Multi-line text loading state via the count prop, the most common pattern for paragraphs and copy blocks.
Loading…
<Skeleton variant="text" count={4} />

Profile Card

An avatar and text combo with a trailing action button, a complete loading state for user cards.
Loading…
Loading…
Loading…
Loading…
Loading…
<Card padding="lg" class="w-full max-w-xs">
  <div class="mb-4 flex items-center gap-3">
    <Skeleton variant="circular" size="lg" />
    <div class="flex flex-1 flex-col gap-2">
      <Skeleton variant="text" size="sm" class="w-3/4" />
      <Skeleton variant="text" size="xs" class="w-1/2" />
    </div>
  </div>
  <Skeleton variant="text" count={3} />
  <div class="mt-4">
    <Skeleton variant="rounded" width="96px" height="32px" />
  </div>
</Card>

Table Rows

Repeat a row of skeletons to mirror tabular content while data is fetched.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
<div
  class="border-border-subtle bg-surface-elevated w-full overflow-hidden rounded-xl border"
>
  {#each [0, 1, 2, 3] as _, i (i)}
    <div
      class="border-border-subtle grid grid-cols-[1fr_1fr_120px_80px] items-center gap-4 px-4 py-3 [&:not(:last-child)]:border-b"
    >
      <Skeleton variant="text" size="sm" class="w-3/4" />
      <Skeleton variant="text" size="sm" class="w-5/6" />
      <Skeleton variant="rounded" width="80px" height="20px" />
      <Skeleton variant="text" size="sm" class="w-12" />
    </div>
  {/each}
</div>

Content Feed

List-item placeholder for article previews, search results, or any vertical feed.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
{#each [0, 1, 2] as _, i (i)}
  <div class="flex gap-4">
    <Skeleton variant="rounded" class="h-20 w-20 shrink-0" />
    <div class="flex flex-1 flex-col gap-2">
      <Skeleton variant="text" size="sm" class="w-5/6" />
      <Skeleton variant="text" size="xs" class="w-full" />
      <Skeleton variant="text" size="xs" class="w-2/3" />
    </div>
  </div>
{/each}

02 Customization

Slot Overrides

Use slotClasses to restyle the base element and the wrapper between multi-line items.
Loading…
Loading…
<Skeleton
  variant="rectangular"
  size="sm"
  slotClasses={{ base: 'bg-primary/10 rounded-2xl' }}
/>
<Skeleton
  variant="text"
  count={3}
  slotClasses={{
    base: 'bg-success/10 rounded-full',
    wrapper: 'gap-3'
  }}
/>

Fully Custom (unstyled)

Drop all defaults and build unique placeholder shapes, for example on dark or branded surfaces.
Loading…
Loading…
Loading…
Loading…
<div class="flex items-center gap-3">
  <Skeleton
    unstyled
    class="h-12 w-12 shrink-0 animate-pulse rounded-full bg-white/5 ring-1 ring-white/10"
  />
  <div class="flex flex-1 flex-col gap-2">
    <Skeleton
      unstyled
      class="h-4 w-3/4 animate-pulse rounded-full bg-linear-to-r from-white/10 via-white/5 to-white/10"
    />
    <Skeleton
      unstyled
      class="h-3 w-1/2 animate-pulse rounded-full bg-linear-to-r from-white/10 via-white/5 to-white/10 [animation-delay:150ms]"
    />
  </div>
</div>
<Skeleton
  unstyled
  class="h-32 w-full animate-pulse rounded-xl bg-white/5 ring-1 ring-white/10 [animation-delay:300ms]"
/>

Branded placeholder shimmer repeats by design. Register the look once under presets.Skeleton on BlocksProvider and apply it with preset. See Customization.

03 Accessibility

Screen Reader

Uses role="status" with aria-label="Loading", a live region that announces the placeholder when it appears. When count > 1, the individual items are marked aria-hidden="true" so only the wrapper is announced. It does not announce completion: on load the skeleton unmounts, and announcing the loaded content is your job.

Reduced Motion

Both pulse and wave animations respect prefers-reduced-motion: reduce. The skeleton still renders as a static colored block to indicate loading.

04 API Reference

13 props
13 props
Prop
Type
Default
Description

05 Types

Local type definitions used by this component.

3 types
Name
Kind
Category
Used by
Description

06 Installation

Import

import { Skeleton } from '@urbicon-ui/blocks';