DefaultsProvider
Structurally transparent context provider that injects a prop-defaults map into all descendant Origam components via useDefaults().
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and description.
- defaultsIDefault
- Map of default prop values keyed by "global" (all components in subtree) or by component name (e.g. "origam-btn": { color: "primary" }).
- disabledboolean
- When true, parent defaults are passed through unchanged — useful to temporarily disable an outer DefaultsProvider without unmounting it.
- resetstring | 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.
- rootstring | 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.
- scopedboolean
- 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
Content slots exposed by this component.
- #default
- Subtree that will receive the injected defaults. The component renders only this slot — it has no visual chrome of its own.
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 a child component. Used by Origam's auto-forwarding pattern.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Notes
- OrigamDefaultsProvider has no visual rendering, no focusable element and no ARIA attributes. All a11y considerations belong to the descendant components it wraps.
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.
Global density override
Per-component defaults
Scoped subtree (no parent inheritance)