Switch
The Switch
component allows users to toggle between two different states. You
can set a specific initial value using the defaultValue
prop for an
uncontrolled switch or setting the initial value of the state of a controlled
switch accordingly. The name
prop also needs to be specified for identifying
the Switch
when submitting it in a form.
Switch vs. Checkbox