SwitchField
A switch allows users to turn things ON or OFF, like a light switch. We can use them when needing to perform instantaneous actions that do not need a review or confirmation, or defining a isLoading prop to show a spinner.
Properties
Switch label
Error message
Style that applies to the container of the switch.
Flag to trigger the movement of the thumb of the switch from one side to the other.
Callback called when after a click the user release the switch, it pass the future value of the switch. Even if the switch is passing the next value the user should set the isActive value to trigger the changes.
Flag used to show an internal spinner.
Flag used to make not clickable the spinner.
Change the inactive color of the background of the switch, default is gray300.
Change the active color of the background of the switch, default is blue.
Change the thumb color of the switch, default is white.
Basic usage
<Switch />
does not render properly here. Please fire up the demo app to see what it really looks like.