Switch
Toggle on or off like a light switch, ideal for binary decisions where a simple tap effortlessly changes states, providing clear and immediate control.
Switch
A switch is a toggle that flips between on and off, similar to a light switch.
Preview
Code
Installation
CLI
Manual
npx hq-kit add switch
Variants
By default, the switch uses the primary
variant, but you can change it to other variant.
Preview
Code
Controlled
You can manage the switch's state by setting the isSelected
prop.
Preview
Code
Dark Mode is disabled
Disabled
A disabled switch cannot be toggled and is non-interactive.
Preview
Code