# Skeleton

Use to show a placeholder while content is loading.

Section: Components / Feedback
Page: https://ui.heyramzi.com/components/skeleton
Import path: `@heyramzi/ui/shadcn/skeleton`

## Import

```ts
import { Skeleton } from "@heyramzi/ui/shadcn/skeleton";
```

## Demo

```svelte
<script lang="ts">
	import { Skeleton } from "@heyramzi/ui/shadcn/skeleton";
</script>

<div class="flex items-center space-x-4">
	<Skeleton class="size-12 rounded-full" />
	<div class="space-y-2">
		<Skeleton class="h-4 w-[250px]" />
		<Skeleton class="h-4 w-[200px]" />
	</div>
</div>
```

## API

### Skeleton.Root

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLDivElement \| null` | `null` | bindable |
| `class` | `string` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`, except `children`.

### Skeleton.Delay

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `loading` | `boolean` |  | required. The data is on its way. |
| `skeleton` | `Snippet` |  | required. What shows while it loads: one or more `Skeleton`s shaped like the content. |
| `children` | `Snippet` |  | required. The content, drawn once loading ends and the skeleton has had its minimum time. |
| `showDelay` | `number` | `SHOW_DELAY_MS` | Ms to wait before the skeleton shows. |
| `minVisible` | `number` | `MIN_VISIBLE_MS` | Ms the skeleton stays once it shows. |
