API and Development
ThemedSwitch wraps Radix RadioGroup with a sliding knob, morphing icon, and per-option knob themes. Pass two or three options (left to right); two options match the Switch dimensions exactly. The type prop (ThemedSwitchType.TwoWay / ThreeWay) controls dimensions and knob travel and defaults to match the number of options. Sizes: ThemedSwitchSize.Small, Medium (default), Large.
Name | Type | Default | Description |
|---|---|---|---|
|
| — | Two or three options, left to right. |
|
| — | Accessible name for the group, used when no external label is provided. |
|
| — | Additional CSS class name applied to the root container. |
|
| — | Default selected value for uncontrolled usage. |
|
| — | Disables the entire control. |
|
| — | ID of an external label element, used to set |
|
|
| Duration of the knob icon morph animation in milliseconds. |
|
| — | Form field name for native submission. |
|
| — | Fired when the selected option changes. |
|
| — | Ref forwarded to the root element. |
|
|
| Size variant. |
|
|
| Number of knob positions. Controls dimensions and knob travel. |
|
| — | Controlled selected value. |
Interactive examples and edge cases for this component are in Storybook.
Name | Type | Default | Description |
|---|---|---|---|
|
|
| Stable id for the option. |
|
|
| Icon shown on the knob when active. |
|
|
| Accessible name for the icon-only option. |
|
|
| Knob theme applied when active. |
|
|
| Disables one option. |
Name | Type | Default | Description |
|---|---|---|---|
|
|
| Binary switch matching ui-core Switch dimensions. |
|
|
| Three-position toggle. |
Name | Type | Default | Description |
|---|---|---|---|
|
|
| Plain high-contrast knob matching the Switch thumb. |
|
|
| Translucent slate knob for neutral / unset states. |
|
|
| Green gradient knob for affirmative states. |
|
|
| Red gradient knob for destructive / negative states. |