A toggle component that allows users to enable or disable a setting with a smooth transition effect.
Basic
A switch is a toggle that flips between on and off, similar to a light switch.
Installation
If you hit any issues, make sure you check out the installation guide here for more information.
Composed components
When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.
The Switch comes packed with several components to enhance functionality and provide a seamless experience.
Manual installation
Make sure you also install the composed components and the required packages for the component to function properly.
Anatomy
Description
You can add a description to the switch by passing the description
prop or using the Description
component.
Controlled
You can manage the switch's state by setting the isSelected
prop.
Uncontrolled
You can also use the uncontrolled version of the switch.
Disabled
A disabled switch cannot be toggled and is non-interactive.