ConfigProvider
The injection entry point for global configuration, centrally managing locale / size / theme for the wrapped subtree. Component resolution order: own attribute > config-provider > global default.
Locale injection
The config-provider's locale takes precedence over the global setLocale(): components inside use the injected locale for built-in copy.
Switching locale
Size injection
Components inside use the injected size unless they set it explicitly; explicitly set size always wins. size supports five tiers: xs / small / medium (default) / large / xl.
Size injection
Theme injection
The config-provider's theme writes data-theme onto itself, and the wrapped subtree (including Shadow DOM) inherits the corresponding theme tokens.
Theme injection
Nearest provider wins
An inner config-provider overrides an outer one: components wrapped by the inner provider use its config, while components under the outer provider (not nested further) use the outer config.
Nearest provider wins
API
Attributes
| Attribute | Description | Type | Default |
|---|---|---|---|
locale | Language for built-in copy in the wrapped subtree (must be registered); takes precedence over global setLocale() | — | — |
size | Default size for wrapped components, applied when a component doesn't set it explicitly | — | — |
theme | Theme for the wrapped subtree, written to data-theme | — | — |
Slots
| Name | Description |
|---|---|
| default | — |
- Component resolution order: own attribute > config-provider > global default.
localerequires the language pack to be registered viaregisterLocale(); falls back to the global translator when unregistered.