Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Feedback

Skeleton

Free11.5 KB gzipped

A soft, rounded placeholder shown while content loads.

Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · No keyboard interaction of its own · Full report

Import

tsx
import {
  Skeleton,
  SkeletonText,
  SkeletonAvatar,
  SkeletonCircle,
  SkeletonGroup,
} from "@vjdesigns/vjdesigns-ui";

Importing only Skeleton adds about 11.5 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.

Examples

Shapes

Placeholders shaped like the content they stand in for.

tsx
import {
  Card,
  Flex,
  Skeleton,
  SkeletonAvatar,
  SkeletonText,
  Stack,
} from "@vjdesigns/vjdesigns-ui";

export function Shapes() {
  return (
    <Card variant="outline" style={{ width: "100%", maxWidth: "24rem" }}>
      <Flex gap={3} align="center">
        <SkeletonAvatar size="lg" />
        <Stack gap={2} style={{ flex: 1 }}>
          <Skeleton variant="text" width="60%" />
          <Skeleton variant="text" width="40%" />
        </Stack>
      </Flex>
      <Skeleton height={140} radius="lg" />
      <SkeletonText lines={3} />
    </Card>
  );
}

Loading to content

SkeletonGroup announces "Loading…" once for the whole region (not per shape), and Skeleton with children swaps to the real content when loading turns off.

tsx
import { useState } from "react";
import {
  Avatar,
  Button,
  Card,
  Flex,
  Skeleton,
  SkeletonGroup,
  Stack,
  Text,
} from "@vjdesigns/vjdesigns-ui";

export function LoadingToContent() {
  const [loading, setLoading] = useState(true);
  return (
    <Stack gap={4} align="center" style={{ width: "100%", maxWidth: "24rem" }}>
      <Card variant="outline" style={{ width: "100%" }}>
        <SkeletonGroup loading={loading} label="Loading profile">
          <Flex gap={3} align="center">
            <Skeleton variant="circle" loading={loading}>
              <Avatar name="Jordan Lee" colorFromName size="lg" />
            </Skeleton>
            <Stack gap={1}>
              <Skeleton loading={loading} variant="text">
                <Text weight="semibold">Jordan Lee</Text>
              </Skeleton>
              <Skeleton loading={loading} variant="text">
                <Text size="sm" tone="muted">
                  Product designer · Seattle
                </Text>
              </Skeleton>
            </Stack>
          </Flex>
        </SkeletonGroup>
      </Card>
      <Button variant="outline" tone="neutral" onClick={() => setLoading((l) => !l)}>
        {loading ? "Finish loading" : "Reload"}
      </Button>
    </Stack>
  );
}

Accessibility

While loading, SkeletonGroup marks the region aria-busy and announces its label once, and the hidden content underneath is inert and aria-hidden, so nothing half-loaded is read or focused. loadedLabel announces when it's ready.

tsx
import { useState } from "react";
import {
  Avatar,
  Button,
  Flex,
  SkeletonAvatar,
  SkeletonGroup,
  SkeletonText,
  Stack,
  Text,
} from "@vjdesigns/vjdesigns-ui";

export function Accessibility() {
  const [loading, setLoading] = useState(true);
  return (
    <Stack gap={4} style={{ width: "100%", maxWidth: "24rem" }}>
      <Button variant="outline" tone="neutral" onClick={() => setLoading((l) => !l)}>
        {loading ? "Finish loading" : "Load again"}
      </Button>
      <SkeletonGroup loading={loading} label="Loading profile" loadedLabel="Profile loaded">
        <Flex gap={3} align="center">
          {loading ? <SkeletonAvatar /> : <Avatar name="Ana Ruiz" />}
          <Stack gap={1} style={{ flex: 1 }}>
            {loading ? <SkeletonText lines={2} /> : <Text weight="semibold">Ana Ruiz · Product lead</Text>}
          </Stack>
        </Flex>
      </SkeletonGroup>
    </Stack>
  );
}

Translated

Without a label, the loading and loaded announcements come from the locale (Spanish here).

tsx
import {
  Card,
  SkeletonGroup,
  SkeletonText,
  LocaleProvider,
} from "@vjdesigns/vjdesigns-ui";
import es from "@vjdesigns/vjdesigns-ui/locales/es";

export function Translated() {
  return (
    <LocaleProvider locale="es" messages={es}>
      <SkeletonGroup loading>
        <Card padding="md" style={{ width: "100%", maxWidth: "24rem" }}>
          <SkeletonText lines={3} />
        </Card>
      </SkeletonGroup>
    </LocaleProvider>
  );
}

Right to left

The first example again, inside a right-to-left LocaleProvider (Arabic). Layout, spacing and arrow icons mirror, and the components' built-in text is translated. The example's own text stays in English.

Shapes

tsx
import { LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ar from "@vjdesigns/vjdesigns-ui/locales/ar";

// Shapes is the "Shapes" example above.
<LocaleProvider locale="ar" messages={ar}>
  <Shapes />
</LocaleProvider>

Usage notes

Use it two ways:

  • Placeholder: <Skeleton variant="text" />, sized with width and height. Renders a decorative span (aria-hidden).
  • Wrapper: <Skeleton loading={isLoading}>{content}</Skeleton>. The content is laid out invisibly under the fill, so the page doesn't shift when it loads. When loading turns false, the same wrapper shows the content.

Accessibility:

  • Placeholders are hidden from assistive technology. While loading, wrapped content is inert and hidden, so it can't be focused or read.
  • Many placeholders shouldn't announce many times: wrap the loading region in one SkeletonGroup (or pass loadingLabel to a single wrapper), which marks the region aria-busy and announces "Loading…" once.

API reference

Skeleton

Skeleton props
PropTypeDefault
variant

Placeholder shape. Ignored in wrapper mode, except that circle and pill round the overlay.

"rect""text""circle""pill""rect"
width

Width as a CSS length (numbers are px). Defaults depend on variant (full width for rect and text).

SkeletonLength—
height

Height as a CSS length (numbers are px). Defaults depend on variant; a circle with only a width stays round.

SkeletonLength—
radius

Corner rounding. Overrides the variant's default (md for rect, sm for text, round for circle, pill for pill).

"none""xs""sm""md""lg""xl""2xl""pill"—
animation

Loading motion. Stops under prefers-reduced-motion: reduce.

"pulse""shimmer""none""pulse"
loading

Wrapper mode only (when children are given): while true, the children are laid out but hidden (visibility: hidden, inert, aria-hidden) under a skeleton fill of the same size, so nothing shifts when the content arrives. While false, the children render normally. Without children, false renders nothing.

booleantrue
inline

Wrapper mode only: render the wrapper as inline-block, so it shrinks to its content (for an Avatar, a Badge, or a Button). By default it is a full-width block (for cards, rows, and paragraphs).

booleanfalse
loadingLabel

Wrapper mode only: when set, the wrapper also announces this text once through a polite role="status" region while loading. Leave it unset when a surrounding SkeletonGroup already announces.

string—
loadedLabel

Wrapper mode only: text announced once loading finishes (e.g. "Profile loaded"). Needs loadingLabel.

string—
children

Real content. When given, Skeleton becomes a wrapper that shows a placeholder shaped like this content while loading.

ReactNode—
ref

The root element: a span for a placeholder, a div in wrapper mode.

Ref<HTMLElement>—

Also accepts native <span> attributes, plus className, style and ref.

SkeletonText

Lines of placeholder text, sized like real Text or Heading content so nothing jumps when the text arrives. The last line is shorter. Decorative (aria-hidden).

SkeletonText props
PropTypeDefault
lines

Number of lines.

number3
lastLineWidth

Width of the last line, as a CSS length (numbers are px). Ignored for a single line unless set.

SkeletonLength"60%"
width

Width of the whole block (numbers are px).

SkeletonLength"100%"
size

Font size of the text this stands in for, matching Typography's size. Each bar is 1em tall inside a 1lh line box, so the block is as tall as the real text.

"xs""sm""md""lg""xl""2xl""3xl""4xl""5xl""6xl""md"
leading

Line height, matching Typography's leading. Use tight for headings.

"tight""snug""normal""relaxed""normal"
gap

Extra space between lines (a --space-* step). Keep 0 to match real text height; line height already spaces the bars.

Space0
animation

Loading motion.

"pulse""shimmer""none""pulse"

Also accepts native <span> attributes, plus className, style and ref.

SkeletonAvatar

A placeholder the exact size and shape of an Avatar. Decorative (aria-hidden).

SkeletonAvatar props
PropTypeDefault
size

Matches Avatar sizes: xs 24px, sm 32px, md 40px, lg 48px, xl 64px, 2xl 96px.

"xs""sm""md""lg""xl""2xl""md"
shape

Matches Avatar shapes.

"circle""rounded""square""circle"
animation

Loading motion.

"pulse""shimmer""none""pulse"

Also accepts native <span> attributes, plus className, style and ref.

SkeletonCircle

A circular placeholder in Avatar sizes (SkeletonAvatar with shape="circle").

SkeletonCircle props
PropTypeDefault
size

Matches Avatar sizes: xs 24px, sm 32px, md 40px, lg 48px, xl 64px, 2xl 96px.

"xs""sm""md""lg""xl""2xl""md"
animation

Loading motion.

"pulse""shimmer""none""pulse"

Also accepts standard HTML attributes, plus className, style and ref.

SkeletonGroup

Wraps a loading region so screen readers get one announcement instead of one per placeholder. The region carries aria-busy while loading; a visually hidden polite role="status" beside it says label once. Put the real content inside the same group, so aria-busy clears on the region that holds it.

SkeletonGroup props
PropTypeDefault
loading

Whether the region is loading. While true it carries aria-busy="true" and label is announced once.

booleantrue
label

Text announced politely when loading starts. Localize it here.

string"Loading…"
loadedLabel

Text announced when loading finishes (e.g. "Results loaded"). Nothing is announced by default.

string—
children

The placeholders while loading, then the real content.

ReactNode—

Also accepts native <div> attributes, plus className, style and ref.

See what changed in each version in the Changelog.

Accessibility report

Skeleton targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.

axe-core audit (live)

Running accessibility audit

Checking the examples above…

Lighthouse audit

Light mode

Score 100

35 passed · 0 failed · 30 not applicable · 10 to check by hand

Dark mode

Score 100

35 passed · 0 failed · 30 not applicable · 10 to check by hand

Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.

Built-in behavior

Keyboard

Not focusable, so there's no keyboard interaction of its own.

Roles and states

Roles and states
ElementRoleStates and properties
Placeholder shapesnonearia-hidden="true"
Loading containernone (generic)aria-busy while loading
Live regionstatusAnnounces loading and loaded

Manual checks

Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.

Manual accessibility checks
CheckWhat to testWCAG 2.2
KeyboardEvery action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck.2.1.1 (A), 2.1.2 (A)
FocusFocus moves in a logical order, is always visible, and isn't hidden behind sticky headers.2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA)
Screen readersNames, roles and states are announced correctly, and status changes are announced without moving focus.1.3.1 (A), 4.1.2 (A), 4.1.3 (AA)
ColorMeaning never depends on color alone; your own colors meet contrast in both modes.1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA)
Zoom and reflowAt 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed.1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA)
Pointer targetsClick and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap.2.5.8 (AA), 2.5.5 (AAA)
MotionAnimations respect the reduced-motion setting.2.3.3 (AAA)