Examples
Default
Second Option Selected
Controlled
All Sizes
Disabled
Props
SwitchToggle
A binary segmented toggle rendered as aradiogroup. The active option is highlighted with a sliding pill indicator. Supports both controlled and uncontrolled usage.
[SwitchToggleOption, SwitchToggleOption]
required
The two options to toggle between (exactly two required).
string
Initially selected value (uncontrolled).
boolean
default:"false"
Whether the toggle is disabled.
((value: string) => void)
Callback fired when the selected value changes.
"24" | "32" | "40"
default:"24"
Height of the toggle in pixels.
string
Currently selected value (controlled).
Exported types
Also exported from@fanvue/ui: SwitchToggleOption, SwitchToggleProps, SwitchToggleSize.
Setup: Installation · Theming