Skeleton

Loading placeholders that mimic the shape of content before it arrives. Skeletons use a shimmering animation by default and support text lines, headings, circles (avatars), rectangles (images), buttons, inputs, lists, and grids — all composable to match your actual layout.

Text & Heading

Sizes

Circles, Rectangles & Form Elements

Circles (avatars)

Rectangles (images)

Form elements

Composite: Card & List

Card placeholder

List placeholder

Grid & Width Utilities

Grid layout

Width utilities

No animation (static)

Pulse animation

CSS Variables
VariableDefaultDescription
--vd-skeleton-bgvar(--vd-color-gray-200)Base placeholder color
--vd-skeleton-shimmervar(--vd-color-gray-100)Shimmer highlight color
--vd-skeleton-border-radiusvar(--vd-btn-border-radius)Default corner rounding
API Reference

Usage

<script setup lang="ts">
import { VdSkeleton } from "@vanduo-oss/vd3";
</script>

<template>
  <VdSkeleton shape="text" :lines="3" />
  <VdSkeleton shape="circle" size="lg" />
  <VdSkeleton shape="rect" width="200px" />
  <VdSkeleton shape="rect" size="lg" width="300px" />
  <VdSkeleton shape="card" size="md" />
  <VdSkeleton shape="button" size="sm" />
</template>

CSS Classes

ClassDescription
.vd-skeletonBase placeholder with shimmer animation and overflow hidden.
.vd-skeleton-textSingle text line (1rem height, 100% width, last sibling auto-shorts to 80%).
.vd-skeleton-text-xsExtra small text line (0.75rem).
.vd-skeleton-text-smSmall text line (0.875rem).
.vd-skeleton-text-lgLarge text line (1.25rem).
.vd-skeleton-text-xlExtra large text line (1.5rem).
.vd-skeleton-paragraphColumn wrapper for multiple text lines with built-in gap and progressive line widths.
.vd-skeleton-headingHeading placeholder (1.5rem, 60% width).
.vd-skeleton-heading-lgLarge heading (2rem, 50% width).
.vd-skeleton-circleCircle shape (border-radius: 50%, 3rem default).
.vd-skeleton-circle-xs … -xlCircle sizes from 1.5rem to 5rem.
.vd-skeleton-rectRectangle placeholder (100% width, 200px height).
.vd-skeleton-rect-smSmall rectangle (100px height).
.vd-skeleton-rect-lgLarge rectangle (300px height).
.vd-skeleton-buttonButton placeholder (2.5rem height, 6rem width).
.vd-skeleton-button-smSmall button (2rem height, 4rem width).
.vd-skeleton-button-lgLarge button (3rem height, 8rem width).
.vd-skeleton-inputInput placeholder (2.5rem height, 100% width).
.vd-skeleton-cardCard wrapper with padding and border.
.vd-skeleton-listVertical flex list for rows with avatar + text.
.vd-skeleton-list-itemFlex row with circle and content columns.
.vd-skeleton-list-item-contentContent column inside a list item.
.vd-skeleton-gridCSS grid container for card/image placeholders.
.vd-skeleton-table-rowFlex row placeholder for table-like loading states, with bottom border spacing.
.vd-skeleton-w-*Width utilities: -w-full, -w-3-4, -w-2-3, -w-1-2, -w-1-3, -w-1-4.
.vd-skeleton-staticDisables the shimmer animation.
.vd-skeleton-pulseReplaces shimmer with an opacity pulse animation.

Component API (Vue 3)

PropDescription
:shapetext | circle | rect | card | button (default text).
:sizesm | md | lg | xl (default md).
:widthExplicit CSS width, e.g. "200px".
:linesNumber of lines when shape="text" (default 1).
Accessibility
  • Always wrap skeleton placeholders in an aria-live="polite" region and replace them with real content once loaded, so screen readers announce the change.
  • Use aria-busy="true" on the container while skeletons are visible to indicate the region is updating.
  • Shimmer animation is disabled when prefers-reduced-motion: reduce is active — the placeholder becomes a static color block.
  • Avoid leaving skeletons visible for extended periods. If loading takes more than a few seconds, show a progress indicator or retry option.
  • Ensure skeleton colors maintain sufficient contrast against the page background in both light and dark themes.