Loader

Feedback & Status
stable

Toggle container that swaps between a loading spinner (OrigamProgress circular) and the default slot content. Carries aria-busy and aria-label when loading.

Aperçu

Rendu de l’aperçu en cours…

loading

Rendu de l’aperçu en cours…

loaded

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamLoaderSchematic of the Loader component in its two states: loading and loaded. loading=true → #loader slot #default slot content loading=false 1 2 3
Anatomy of <origam-loader> — ① loading state (root with aria-busy, spinner rendered via #loader slot), ② loaded state (#default content visible), ③ OrigamProgress spinner (size=23, width=2, type=circular).
1.origam-loader (loading)
Root element while loading is truthy. Carries aria-busy="true" and aria-label="Loading". Renders the #loader slot.
2.origam-loader (loaded)
Root element while loading is falsy. aria-busy and aria-label are absent. Renders the #default slot.
3.origam-loader__progress
OrigamProgress circular spinner injected in the default #loader slot. margin: auto centres it. Can be replaced by a custom slot.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

fullscreen
boolean
loading
false
When truthy, hides the default slot and shows the #loader slot (or OrigamProgress by default). Sets aria-busy="true" and aria-label="Loading" on the root.
loadingText
string
Override for the aria-label text shown while loading. Defaults to "Loading".
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
tag
string
'span'
Root HTML element tag.
color
Color passed to the OrigamProgress spinner shown in the loader slot.

API

Slots

Emplacements de contenu exposés par ce composant.

#loader
Rendered when loading is truthy. Defaults to OrigamProgress (circular, size=23, width=2). Override to provide a custom spinner.
#default
Rendered when loading is falsy. This is the normal content.

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 a child.
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 into the DOM.

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.

Height of the root element. Defaults to 100% to fill its parent.
Position value when the fullscreen modifier class is applied.
Height in fullscreen mode.
Width in fullscreen mode.
Margin around the progress spinner — auto centres it.

Inclusion

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Notes

  • While loading, the root carries <code>aria-busy="true"</code> and <code>aria-label="Loading"</code> (or the custom loadingText). Screen readers announce the loading state.
  • For critical async operations that change page content, consider wrapping OrigamLoader in a live region (<code>aria-live="polite"</code>) so the transition from loading to loaded is announced.

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.

Source
other
100%
Default height of the loader root.
other
auto
Margin around the progress element in the loader slot.
other
fixed
Position in fullscreen mode.
other
100vh
Height in fullscreen mode.

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 usage

vue

Custom spinner slot

vue

Fullscreen loader

vue