Pick light, dark or the system's theme in one control, built on Base UI.
Installation
Component API
| Prop | Type | Default | Description |
|---|---|---|---|
value | light | dark | system | - | |
defaultValue | light | dark | system | system | The theme picked on first render, uncontrolled. |
| The theme picked on first render, uncontrolled. | |||
onValueChange | (value: "light" | "dark" | "system") => void | - | |
storageKey | string | - | |
iconOnly | boolean | false | |
variant | segmented | cycle | segmented | segmented shows every theme on a track; cycle is one button that moves System, Light, Dark on each press, showing the current one. |
segmented shows every theme on a track; cycle is one button that moves System, Light, Dark on each press, showing the current one. | |||
size | sm | md | md | Height of the track and its options, or of the cycle button. |
Height of the track and its options, or of the cycle button. | |||
shape | none | rounded | pill | rounded | |
disabled | boolean | false | Blocks every option and dims the control. |
| Blocks every option and dims the control. | |||
animated | boolean | true | |
className | string | - | |
focus | boolean | string | true | |