Switch
Native Solid 2 fork. Original documentation and designs © WorkOS; historical posts retain their original context.
API Reference
This component inherits props from the Switch primitive and supports common margin props.
Examples
Size
Use the size prop to control the size of the switch.
Variant
Use the variant prop to control the visual style of the switch.
Color
Use the color prop to assign a specific color.
High-contrast
Use the highContrast prop to increase color contrast in light mode.
Radius
Use the radius prop to assign a specific radius value.
Alignment
Composing Switch within Text automatically centers it with the first line of text.
It is automatically well-aligned with multi-line text too.
Disabled
Use the native disabled attribute to create a disabled switch.