ThemeProvider
Utilities & Providers
stable
Overrides the active theme and/or color mode for a sub-tree by setting data-theme and data-mode attributes on a display:contents wrapper.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-theme-provider> — a single display:contents wrapper ① that rewrites data-theme and data-mode on its root element. Child components resolve their CSS custom properties against this new scope automatically.- 1.origam-theme-provider
- Root wrapper element (div by default). display:contents ensures it has no layout impact. data-theme and data-mode are set from the theme and mode props, enabling CSS variable scope resolution for all descendant components.
API
Props
All props accepted by this component, with their type, default value and description.
- Brand/theme name to activate on this sub-tree. Rendered as data-theme="{name}". Pass 'auto' to defer to the closest ancestor (no attribute rendered).
- Color mode: 'light', 'dark', or 'auto' (inherit from ancestor). Rendered as data-mode="{mode}" so CSS can scope token overrides to this sub-tree.
- tagstring'div'
- HTML tag for the wrapper element. Defaults to div (display:contents). Use 'section' / 'article' when the wrapper carries semantic meaning.
API
Slots
Content slots exposed by this component.
- #default
- Sub-tree whose CSS custom properties are resolved against the provided theme and/or mode.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
(none — display:contents wrapper)
Notes
- The root wrapper uses display:contents — it is invisible to the layout engine and does not create an extra stacking context or box. It should not affect the accessibility tree of its children.
- When the sub-tree is a semantic region, use tag='section' or tag='article' to add semantic meaning to the wrapper instead of the invisible div default.
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.
Dark island inside a light page
Brand sub-tree
Semantic tag override