Skip to content
Alpha

Hololink UI is under active development. Components, APIs and these docs may change without notice.

Holo Skeleton

The <holo-skeleton> component renders a decorative (aria-hidden="true") placeholder block while content is loading. Pair it with a surrounding role="status" region if the loading state itself needs to be announced.

Use it for:

  • A placeholder shape that stands in for text, an avatar or a block while content loads, so the layout does not jump.
  • Loading states that last long enough to be noticed.

Don’t use it for:

  • Showing progress. Use Progress or Spinner.
  • Empty or error states. Show a message with Alert.
  • Real content. A skeleton carries no information.
<holo-skeleton variant="circle"></holo-skeleton>
<holo-skeleton variant="text" width="8rem"></holo-skeleton>
<holo-skeleton variant="rect" height="6rem"></holo-skeleton>

The skeleton is purely decorative. The host sets aria-hidden="true", so assistive technology ignores it, and it is not focusable. The shimmer only runs when prefers-reduced-motion: no-preference.

You provide:

  • A way to tell non-visual users that content is loading, since the skeleton is hidden from them. Set aria-busy="true" on the loading region, and announce completion, or include a Spinner or Visually Hidden text such as “Loading”.
  • Removal of the skeletons when content arrives, and focus handling if the user was waiting.

Importing

import '@philbob-sideprojects/hololink-ui/holo-skeleton';

Properties

PropertyAttributeTypeDefaultDescription
heightheightstring—The rendered height (any valid CSS length, e.g. "1rem", "3rem").
variantvariant"circle" | "rect" | "text"'text'The shape of the placeholder block.
widthwidthstring—The rendered width (any valid CSS length, e.g. "100%", "4rem").

CSS custom properties

PropertyDescription
--holo-skeleton-bgBackground color of the placeholder.
--holo-skeleton-radiusCorner radius of the text and rect variants.
--holo-skeleton-shimmer-colorHighlight color of the shimmer animation.