Skeleton

Feedback & Status
stable

Loading placeholder with an opacity pulse. Supports text, rectangular, circular and pill variants — primitives to compose inside an OrigamSkeletonGroup. Renders real content via the default slot when loading=false.

Preview

Rendering the live preview…

text

Rendering the live preview…

rectangular

Rendering the live preview…

circular

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamSkeletonSchematic of the Skeleton component with 1 numbered part: the placeholder block. rectangular variant (standalone) 1
Anatomy of <origam-skeleton> — 1 part: the placeholder block ①.
1.origam-skeleton
The single-block element rendered for every variant (text, rectangular, circular, pill). Inside an OrigamSkeletonGroup it is aria-hidden and the group makes the one announcement.

API

Props

All props accepted by this component, with their type, default value and description.

variant
'rectangular'
Skeleton shape primitive. 'text' → single-line text height, 'rectangular' → block shape, 'circular' → circle (height mirrors width), 'pill' → fully rounded capsule.
loading
boolean
true
Controls skeleton vs real content. true = show skeleton placeholder; false = render the default slot.
pulse
boolean
true
Enables the wave shimmer animation on text and rectangular variants, and the spin animation on circular. Disabled automatically under prefers-reduced-motion.
animation
TSkeletonAnimation
label
string
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
color
Override the skeleton foreground color.
bgColor
Override the skeleton background color.
size
'default'
Size token applied to the skeleton (affects font-size / dimensional scale).
Border-radius override. Defaults to circular token for variant=circular.
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
height
number | string
Height of the skeleton block. Defaults to --origam-skeleton---text-height (1.2em) for text variant; mirrors width for circular.
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
Width of the skeleton block. Accepts a CSS length or a number (px). Defaults to 100% for text variant.

API

Slots

Content slots exposed by this component.

#default
Real content rendered when loading=false. When loading=true, the default slot is hidden and the skeleton placeholder is shown instead.

API

Exposed members

Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to child components.
Ref<string>
Reactive CSS string generated by useStyle.
string
Unique style-sheet ID for this instance.
() => void
Injects the computed style sheet. Called automatically on mount.
() => void
Removes the injected style sheet. Called automatically on unmount.
Ref<boolean>
True once the style sheet has been injected.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Base background color of the skeleton block.
Border-radius for text and rectangular variants.
Border-radius for circular variant (50% = full circle).
Duration of the shimmer / spin animation.
Height of the text variant block.
Gap of an OrigamSkeletonGroup.
Highlight color of the shimmer wave. Derived from background-color by default.

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

status

Notes

  • Each skeleton block has role="status", aria-busy="true" and aria-label="Loading". This ensures screen readers announce the loading state without repeating a full description.
  • The pulse animation is disabled under prefers-reduced-motion: reduce. The skeleton remains visible as a static placeholder.
  • When loading=false, the skeleton is replaced by real content via the default slot. Ensure the revealed content is semantically correct (headings, alt text, etc.).

Foundation

Design tokens

Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.

Source
color
color-mix(in srgb, currentColor 10%, transparent)
Base placeholder background color.
dimension
var(--origam-radius---sm)
Border-radius for text and rectangular variants.
dimension
var(--origam-radius---full)
Border-radius for circular variant.
duration
var(--origam-motion__duration---loop)
Pulse animation duration.
dimension
0.7em
Text variant line height.
dimension
var(--origam-space---3)
Gap of an OrigamSkeletonGroup.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Basic variants

vue

Loading gate

vue

Without pulse

vue