Skeleton
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…
textRendering the live preview…
rectangularRendering the live preview…
circularStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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.
- Skeleton shape primitive. 'text' → single-line text height, 'rectangular' → block shape, 'circular' → circle (height mirrors width), 'pill' → fully rounded capsule.
- loadingbooleantrue
- Controls skeleton vs real content. true = show skeleton placeholder; false = render the default slot.
- pulsebooleantrue
- Enables the wave shimmer animation on text and rectangular variants, and the spin animation on circular. Disabled automatically under prefers-reduced-motion.
- animationTSkeletonAnimation
- labelstring
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Override the skeleton foreground color.
- bgColor
- Override the skeleton background color.
- Size token applied to the skeleton (affects font-size / dimensional scale).
- Border-radius override. Defaults to circular token for variant=circular.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- heightnumber | string
- Height of the skeleton block. Defaults to --origam-skeleton---text-height (1.2em) for text variant; mirrors width for circular.
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | 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
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.
- colorcolor-mix(in srgb, currentColor 10%, transparent)
- Base placeholder background color.
- dimensionvar(--origam-radius---sm)
- Border-radius for text and rectangular variants.
- dimensionvar(--origam-radius---full)
- Border-radius for circular variant.
- durationvar(--origam-motion__duration---loop)
- Pulse animation duration.
- dimension0.7em
- Text variant line height.
- dimensionvar(--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
Loading gate
Without pulse