DefaultsProvider

Utilities & Providers
stable

Structurally transparent context provider that injects a prop-defaults map into all descendant Origam components via useDefaults().

Structure

Anatomie

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

Anatomy of OrigamDefaultsProviderSchematic showing the provider renders only its default slot with no visual chrome. origam-defaults-provider (no DOM output) child component child component …more 1 2 ① Provider (transparent) injects defaults via provide() — no DOM node rendered
Anatomy of <origam-defaults-provider> — structurally transparent. The component renders only the #default slot; it injects defaults via Vue's provide() / inject() without any DOM output of its own.
1.origam-defaults-provider (no DOM)
The provider itself. Calls provideDefaults() once on setup, then renders only <slot name="default"/>. No wrapper element is injected into the DOM.
2#default slot — descendant components
Any Origam component in the subtree that calls useDefaults() automatically picks up the injected map. Child components are NOT aware of being wrapped.

API

Props

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

defaults
IDefault
Map of default prop values keyed by "global" (all components in subtree) or by component name (e.g. "origam-btn": { color: "primary" }).
disabled
boolean
When true, parent defaults are passed through unchanged — useful to temporarily disable an outer DefaultsProvider without unmounting it.
reset
string | number
When set, parent defaults are NOT inherited; the subtree starts from this provider's defaults only. The value is opaque but useful for DevTools tracing.
root
string | number
Marks the provider as a root scope — equivalent to reset but communicates intent: this is the top of a defaults tree, not a mid-tree override.
scoped
boolean
When true, parent defaults are not merged in — the subtree only sees this provider's defaults. Same effect as reset but expressed declaratively.

API

Slots

Emplacements de contenu exposés par ce composant.

#default
Subtree that will receive the injected defaults. The component renders only this slot — it has no visual chrome of its own.

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 component. Used by Origam's auto-forwarding pattern.

Inclusion

Accessibilité

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

Notes

  • OrigamDefaultsProvider has no visual rendering, no focusable element and no ARIA attributes. All a11y considerations belong to the descendant components it wraps.

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.

Global density override

vue

Per-component defaults

vue

Scoped subtree (no parent inheritance)

vue