ThemeModeSelect
Overview
SThemeModeSelect is a context-bound dropdown bound to the active SConfigProvider theme. It exposes the three ThemeModePreference options — auto (follows the OS prefers-color-scheme), light, and dark — each with a scheme icon, letting users pick a color scheme preference directly.
Usage
Features
- 🌓 Three options —
auto/light/dark, matching the thememodetype - 🎚 Selection writes the preference through the shared theme context
- 🎨 Inherits
sizefrom the theme, with per-option scheme icons by default - 🧩
showIcontoggles the monitor / sun / moon glyphs in the trigger and options
Demos
Basic
API
Aria Layer
1ThemeModeSelect
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | ThemeSize | 'md' | Visual size of the select trigger. |
showIcon | boolean | true | Whether to render a scheme icon (monitor / sun / moon) in the trigger and
each option. |
Notes
Scope
Like SThemeModeSwitch, SThemeModeSelect is a theme-layer component that operates on the theme context from a parent SConfigProvider. It does not accept a modelValue; the preference is owned by the provider and shared across all theme components.
Cautions
- The component must be rendered inside a
SConfigProvider, otherwiseuseThemethrows. autois a preference — the resolved scheme (light/dark) still depends on the OSprefers-color-schemeand is exposed aseffectiveModeon the theme context.