2.0 alpha
These docs describe 2.0. Install it with @once-ui-system/core@alpha.
On 1.8.x? Read the 1.x docs
TrademarkTrademarkDocs
Ctrl k
Search docs...
Components

ThemeSwitcher

Updated: September 15, 2026
View on GitHub
Use ThemeSwitcher to provide users with a quick way to toggle between themes. It integrates with ThemeProvider and uses useTheme() under the hood.
  • Highlights the active theme using the "primary" variant, and exposes it to assistive technology with aria-pressed.
  • Automatically updates the global theme via useTheme().setTheme.
  • Renders a row of three icons: system, dark, light.
collapsed shows only the active theme and reveals the rest on hover or focus. Use it where the control has to be reachable from every page but should not spend three slots of a header on itself. It stays a real toggle group. Every option keeps its tab stop, so tabbing into the group opens it; and a device that cannot hover gets all three from the start, because otherwise the only way in would be to tap the visible button — which would have already changed the theme. The width transition is the only motion, and prefers-reduced-motion turns it off. Pass any valid Row props to control spacing, padding, layout, etc.
Prop
Type
Default
collapsed
boolean
ref
HTMLDivElement
className
string
style
React.CSSProperties
…and every FlexProps propinherited
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club