---
title: "Skeleton"
description: "A pulsing placeholder that holds the shape of loading content."
category: "Feedback & Status"
slug: skeleton
url: /components/skeleton
since: "0.2.0"
status: "stable"
---

# Skeleton

A pulsing placeholder that holds the shape of loading content.

## Import

```svelte
import { Skeleton } from '@elluzion/iv-ui';
```

## Preview

Rectangle, text line, and circle placeholders.

```svelte
<script lang="ts">
	import { Skeleton } from '@elluzion/iv-ui';
</script>

<div class="stack">
	<Skeleton shape="rect" height={72} />
	<Skeleton shape="line" />
	<Skeleton shape="line" width="70%" />
	<Skeleton shape="circle" />
</div>

<style>
	.stack {
		display: flex;
		flex-direction: column;
		gap: var(--iv_spacing-md);
		width: 100%;
		max-width: 320px;
	}
</style>
```

## Usage

- `shape` picks rect, line, or circle; `width` and `height` accept numbers or CSS lengths.
- Match the dimensions of the content that replaces it to avoid layout shift.
- Combine several skeletons to sketch a list or card while data loads.

## Examples

### Card placeholder

A composition that mirrors the final card layout.

```svelte
<script lang="ts">
	import { Card, Skeleton } from '@elluzion/iv-ui';
</script>

<Card padding="lg">
	<div class="head">
		<Skeleton shape="circle" width={32} height={32} />
		<div class="meta">
			<Skeleton shape="line" width="45%" />
			<Skeleton shape="line" width="30%" />
		</div>
	</div>
	<Skeleton shape="line" />
	<Skeleton shape="line" width="85%" />
	<Skeleton shape="line" width="60%" />
</Card>

<style>
	.head {
		display: flex;
		align-items: center;
		gap: var(--iv_spacing-md);
		margin-bottom: var(--iv_spacing-lg);
	}

	.meta {
		display: flex;
		flex: 1;
		flex-direction: column;
		gap: var(--iv_spacing-xs);
	}
</style>
```

### Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `shape` | `'rect' \| 'line' \| 'circle'` | `'rect'` | Visual shape of the placeholder. |
| `width` | `string \| number` | — | Width; numbers are treated as pixels. |
| `height` | `string \| number` | — | Height; numbers are treated as pixels. |
| `className` | `string` | `''` | Extra classes merged onto the root element. |

### Tokens used

`--iv_avatar-md` · `--iv_ease-in-out` · `--iv_radius-sm` · `--iv_surface-elevated`

See the [token reference](/foundations/tokens.md) for values.

### CSS hooks

`.iv-circle` · `.iv-line` · `.iv-rect` · `.iv-skeleton`

## Accessibility

- Skeletons are hidden from assistive technology.
- The pulse stops when `prefers-reduced-motion` is set.
- Announce loading elsewhere, for example with `role="status"` or an `Alert`.

## Related

- [LoadingSpinner](/components/loading-spinner.md)
- [Progress](/components/progress.md)
- [Card](/components/card.md)
- [EmptyState](/components/empty-state.md)