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.
Aperçu
Rendu de l’aperçu en cours…
textRendu de l’aperçu en cours…
rectangularRendu de l’aperçu en cours…
circularStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #default
- Real content rendered when loading=false. When loading=true, the default slot is hidden and the skeleton placeholder is shown instead.
API
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <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.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
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.).
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- 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.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic variants
Loading gate
Without pulse