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.

Anatomy of OrigamThemeProviderSchematic of the ThemeProvider — a display:contents wrapper that rewrites data-theme / data-mode. data-theme="ocean" data-mode="dark" display: contents — no layout impact child component A child component B 1 origam-theme-provider
Anatomy of <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.

theme
'auto'
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).
mode
'auto'
Color mode: 'light', 'dark', or 'auto' (inherit from ancestor). Rendered as data-mode="{mode}" so CSS can scope token overrides to this sub-tree.
tag
string
'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

vue

Brand sub-tree

vue

Semantic tag override

vue