Profile loading
Reserve the expected avatar and text layout while data arrives.
Components / Display
A decorative placeholder block for loading layouts.
Last changed in version 0.14.2: Improve keyboard navigation, action feedback, and selected colors across Vue components.
bunx --bun @getweini/cli@latest add skeletonImport the files copied by the install command, then place the component in your Vue template. The text and values in the example belong to your app; change them to fit your task.
<script setup lang="ts">
import Skeleton from './components/ui/skeleton/Skeleton.vue'
</script>
<template>
<section aria-busy="true" aria-label="Loading profile">
<Skeleton shape="circle" class="size-10" />
<Skeleton class="mt-3 h-4 w-40" />
</section>
</template>Skeleton is always aria-hidden. Put aria-busy, loading names, and any status text on the containing region; animation honors reduced-motion preferences.
Reserve the expected avatar and text layout while data arrives.
Avoid layout jumps while several rows are fetched.
Set busy state on the whole region, not on each shape.
<script setup lang="ts">
import Skeleton from './components/ui/skeleton/Skeleton.vue'
</script>
<template>
<section aria-busy="true" aria-label="Loading profile" class="flex items-center gap-3">
<Skeleton shape="circle" class="size-12" />
<div>
<Skeleton class="h-4 w-36" />
<Skeleton class="mt-2 h-3 w-24" />
</div>
</section>
</template>Use li so the placeholder matches the final list structure.
<script setup lang="ts">
import Skeleton from './components/ui/skeleton/Skeleton.vue'
</script>
<template>
<ul aria-busy="true" aria-label="Loading messages">
<Skeleton v-for="row in 3" :key="row" as="li" class="my-2 h-10 w-full" />
</ul>
</template>Every public prop, model, event, slot, and exposed member of the installed Vue parts is listed below. “Not set” means you can leave that value out; “Required” means you must provide it. Native HTML attributes also work where the component uses a native element.
| Name | Type or signature | Default | What it does |
|---|---|---|---|
asprop | "div" | "li" | "span" | undefined | "div" | Choose the HTML element or Vue component used for this control. |
shapeprop | "circle" | "rounded" | "rectangle" | undefined | "rounded" | Choose the component’s visible outline. |
animatedprop | boolean | undefined | true | Turn the visual animation on or off. |
// packages/frameworks/vue/components/skeleton/types.ts
// ------- TYPES -------
export interface SkeletonProps {
as?: 'div' | 'span' | 'li'
shape?: 'rectangle' | 'rounded' | 'circle'
animated?: boolean
}