Skip to content

Search documentation

Search guides, examples, and component APIs.

Quick links
↑↓ NavigateEnter OpenEsc Close
Get started

Documentation navigation

Components / Display

Skeleton

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.

Interactive showcase

Install

Run in your project
bunx --bun @getweini/cli@latest add skeleton

Start with this example

Import 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.

Vue
<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.

When to use it

Profile loading

Reserve the expected avatar and text layout while data arrives.

List loading

Avoid layout jumps while several rows are fetched.

More examples

Profile placeholder

Set busy state on the whole region, not on each shape.

Profile placeholder
<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>

Three pending rows

Use li so the placeholder matches the final list structure.

Three pending rows
<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>

Complete API

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.

Skeleton

Complete API for Skeleton
NameType or signatureDefaultWhat 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.
animatedpropboolean | undefinedtrueTurn the visual animation on or off.
Public type definitions
Public types
// packages/frameworks/vue/components/skeleton/types.ts
// ------- TYPES -------

export interface SkeletonProps {
  as?: 'div' | 'span' | 'li'
  shape?: 'rectangle' | 'rounded' | 'circle'
  animated?: boolean
}

Implementation notes

  • Match the approximate size of final content to reduce layout movement.
  • Replace the placeholder when data is ready; a skeleton should not remain beside loaded content.

Accessibility and localization

  • Skeleton shapes are always hidden from assistive technology; name the busy container or provide status text.

Source contract and editing guidance