eidos.components.theme
Theme switching component for EidosUI
Theme switcher button that toggles between light and dark themes.
Works automatically when EidosHeaders(include<em>theme</em>switcher=True) is used.
Features: - Respects system color scheme preference as default - Persists user's choice in localStorage - Updates the data-theme attribute on document root - Changes button icon/text based on current theme
Args:
light_icon: Icon/text shown in light mode (default: ☀️)dark_icon: Icon/text shown in dark mode (default: 🌙)class_: Additional CSS classesvariant: Display variant - "icon" for just icons, "text" for labels**props: Additional button props
Example:
```python from eidos import EidosHeaders, ThemeSwitch
Head(*EidosHeaders()) # Includes theme switcher by default Body( NavBar(ThemeSwitch()) # Simple icon toggle )
# With custom styling ThemeSwitch(class_="p-3 rounded-lg")
# Text variant ThemeSwitch(variant="text") <code style="background:var(--color-surface);padding:2px 4px;border-radius:4px;"></code>`
Parameters:
light_icon: <class 'str'> = ☀️dark_icon: <class 'str'> = 🌙class_: <class 'str'>variant: typing.Literal['icon', 'text'] = icon