Skeleton
Grey shapes that stand in for content while it loads. Same markup and props in every style: switch the style in the header to see it change.
Profile
A round picture and two lines of text.
<div role="status" aria-label="Loading profile" style="display: flex; align-items: center; gap: 12px; width: 100%; max-width: 280px">
<div class="vin-skeleton vin-skeleton--circle" style="width: 44px"></div>
<div style="flex: 1; display: grid; gap: 8px">
<div class="vin-skeleton vin-skeleton--text" style="width: 70%"></div>
<div class="vin-skeleton vin-skeleton--text" style="width: 45%"></div>
</div>
</div>import { Skeleton } from "@/components/vin/skeleton";
export function SkeletonProfile() {
return (
<div role="status" aria-label="Loading profile" style={{ display: "flex", alignItems: "center", gap: 12, width: "100%", maxWidth: 280 }}>
<Skeleton shape="circle" style={{ width: 44 }} />
<div style={{ flex: 1, display: "grid", gap: 8 }}>
<Skeleton shape="text" style={{ width: "70%" }} />
<Skeleton shape="text" style={{ width: "45%" }} />
</div>
</div>
);
}The Vue version renders the same markup as the HTML tab, so it looks and works the same.
<script setup lang="ts">
import Skeleton from "@/components/vin/skeleton.vue";
</script>
<template>
<div role="status" aria-label="Loading profile" style="display: flex; align-items: center; gap: 12px; width: 100%; max-width: 280px">
<Skeleton shape="circle" style="width: 44px" />
<div style="flex: 1; display: grid; gap: 8px">
<Skeleton shape="text" style="width: 70%" />
<Skeleton shape="text" style="width: 45%" />
</div>
</div>
</template>The Svelte version renders the same markup as the HTML tab, so it looks and works the same.
<script lang="ts">
import Skeleton from "$lib/components/vin/skeleton.svelte";
</script>
<div role="status" aria-label="Loading profile" style="display: flex; align-items: center; gap: 12px; width: 100%; max-width: 280px">
<Skeleton shape="circle" style="width: 44px" />
<div style="flex: 1; display: grid; gap: 8px">
<Skeleton shape="text" style="width: 70%" />
<Skeleton shape="text" style="width: 45%" />
</div>
</div>Card
A media block, a title, text and a button, inside a Card.
<div class="vin-card" role="status" aria-label="Loading article" style="width: 100%; max-width: 300px; overflow: hidden">
<div class="vin-skeleton" style="height: 140px; border-radius: 0"></div>
<div class="vin-card__body" style="display: grid; gap: 10px">
<div class="vin-skeleton" style="height: 18px; width: 65%"></div>
<div class="vin-skeleton vin-skeleton--text"></div>
<div class="vin-skeleton vin-skeleton--text" style="width: 85%"></div>
<div class="vin-skeleton" style="height: 36px; width: 110px; margin-top: 6px"></div>
</div>
</div>import { Card, CardBody } from "@/components/vin/card";
import { Skeleton } from "@/components/vin/skeleton";
export function SkeletonCard() {
return (
<Card role="status" aria-label="Loading article" style={{ width: "100%", maxWidth: 300, overflow: "hidden" }}>
<Skeleton style={{ height: 140, borderRadius: 0 }} />
<CardBody style={{ display: "grid", gap: 10 }}>
<Skeleton style={{ height: 18, width: "65%" }} />
<Skeleton shape="text" />
<Skeleton shape="text" style={{ width: "85%" }} />
<Skeleton style={{ height: 36, width: 110, marginTop: 6 }} />
</CardBody>
</Card>
);
}The Vue version renders the same markup as the HTML tab, so it looks and works the same.
<script setup lang="ts">
import Card, { CardBody } from "@/components/vin/card.vue";
import Skeleton from "@/components/vin/skeleton.vue";
</script>
<template>
<Card role="status" aria-label="Loading article" style="width: 100%; max-width: 300px; overflow: hidden">
<Skeleton style="height: 140px; border-radius: 0" />
<CardBody style="display: grid; gap: 10px">
<Skeleton style="height: 18px; width: 65%" />
<Skeleton shape="text" />
<Skeleton shape="text" style="width: 85%" />
<Skeleton style="height: 36px; width: 110px; margin-top: 6px" />
</CardBody>
</Card>
</template>The Svelte version renders the same markup as the HTML tab, so it looks and works the same.
<script lang="ts">
import Card from "$lib/components/vin/card.svelte";
import CardBody from "$lib/components/vin/card-body.svelte";
import Skeleton from "$lib/components/vin/skeleton.svelte";
</script>
<Card role="status" aria-label="Loading article" style="width: 100%; max-width: 300px; overflow: hidden">
<Skeleton style="height: 140px; border-radius: 0" />
<CardBody style="display: grid; gap: 10px">
<Skeleton style="height: 18px; width: 65%" />
<Skeleton shape="text" />
<Skeleton shape="text" style="width: 85%" />
<Skeleton style="height: 36px; width: 110px; margin-top: 6px" />
</CardBody>
</Card>List
Repeat a row for a list. Vary the line widths so it looks like text.
<div role="status" aria-label="Loading messages" style="display: grid; gap: 18px; width: 100%; max-width: 320px">
<div style="display: flex; align-items: center; gap: 12px">
<div class="vin-skeleton vin-skeleton--circle" style="width: 36px"></div>
<div style="flex: 1; display: grid; gap: 8px">
<div class="vin-skeleton vin-skeleton--text" style="width: 40%"></div>
<div class="vin-skeleton vin-skeleton--text" style="width: 90%"></div>
</div>
</div>
<div style="display: flex; align-items: center; gap: 12px">
<div class="vin-skeleton vin-skeleton--circle" style="width: 36px"></div>
<div style="flex: 1; display: grid; gap: 8px">
<div class="vin-skeleton vin-skeleton--text" style="width: 55%"></div>
<div class="vin-skeleton vin-skeleton--text" style="width: 75%"></div>
</div>
</div>
<div style="display: flex; align-items: center; gap: 12px">
<div class="vin-skeleton vin-skeleton--circle" style="width: 36px"></div>
<div style="flex: 1; display: grid; gap: 8px">
<div class="vin-skeleton vin-skeleton--text" style="width: 35%"></div>
<div class="vin-skeleton vin-skeleton--text" style="width: 80%"></div>
</div>
</div>
</div>import { Skeleton } from "@/components/vin/skeleton";
const rows = [["40%", "90%"], ["55%", "75%"], ["35%", "80%"]];
export function SkeletonList() {
return (
<div role="status" aria-label="Loading messages" style={{ display: "grid", gap: 18, width: "100%", maxWidth: 320 }}>
{rows.map(([a, b], i) => (
<div key={i} style={{ display: "flex", alignItems: "center", gap: 12 }}>
<Skeleton shape="circle" style={{ width: 36 }} />
<div style={{ flex: 1, display: "grid", gap: 8 }}>
<Skeleton shape="text" style={{ width: a }} />
<Skeleton shape="text" style={{ width: b }} />
</div>
</div>
))}
</div>
);
}The Vue version renders the same markup as the HTML tab, so it looks and works the same.
<script setup lang="ts">
import Skeleton from "@/components/vin/skeleton.vue";
const rows = [["40%", "90%"], ["55%", "75%"], ["35%", "80%"]];
</script>
<template>
<div role="status" aria-label="Loading messages" style="display: grid; gap: 18px; width: 100%; max-width: 320px">
<div v-for="([a, b], i) in rows" :key="i" style="display: flex; align-items: center; gap: 12px">
<Skeleton shape="circle" style="width: 36px" />
<div style="flex: 1; display: grid; gap: 8px">
<Skeleton shape="text" :style="{ width: a }" />
<Skeleton shape="text" :style="{ width: b }" />
</div>
</div>
</div>
</template>The Svelte version renders the same markup as the HTML tab, so it looks and works the same.
<script lang="ts">
import Skeleton from "$lib/components/vin/skeleton.svelte";
const rows = [["40%", "90%"], ["55%", "75%"], ["35%", "80%"]];
</script>
<div role="status" aria-label="Loading messages" style="display: grid; gap: 18px; width: 100%; max-width: 320px">
{#each rows as [a, b], i (i)}
<div style="display: flex; align-items: center; gap: 12px">
<Skeleton shape="circle" style="width: 36px" />
<div style="flex: 1; display: grid; gap: 8px">
<Skeleton shape="text" style="width: {a}" />
<Skeleton shape="text" style="width: {b}" />
</div>
</div>
{/each}
</div>Installation
React, Vue and Svelte: add the component to your project with the CLI. It reads your framework from vin.json and also copies any component this one needs. Then import it:
npx @vinish/ui add skeletonimport { Skeleton } from "@/components/vin/skeleton";import Skeleton from "@/components/vin/skeleton.vue";import Skeleton from "$lib/components/vin/skeleton.svelte";The import paths assume the default folders: @/components/vin (React and Vue, with the usual @ → src alias) and $lib/components/vin (SvelteKit). Use your own if you chose another folder in init. How the Vue and Svelte versions pass values and content is in Frameworks.
Plain HTML: the classes come with the style's stylesheet. It needs no JavaScript.
API
From spec/skeleton.json, which every framework version is tested against.
| Prop | Values | Default | In HTML |
|---|---|---|---|
shape | blocktextcircle | block | vin-skeleton--{value} |
width / heightSize each shape like the content it replaces. | CSS size | — | style="width: …; height: …" |
Parts
| React, Vue, Svelte | HTML classes |
|---|---|
<Skeleton> | .vin-skeleton.vin-skeleton--text.vin-skeleton--circle |
Accessibility
- Wrap the shapes in one element with role="status" and an aria-label ("Loading profile"), so screen readers hear one message, not a list of empty boxes.
- Remove the skeleton when the content arrives; the real content takes its place.
- The shimmer stops when the user asks for reduced motion.
Customize
Saved in this browser. Style and accent are in the header.