Switch
Please refer to MUI's official docs for more details on component's usage guide and API documentation.
Basic Switches
Controlled and Uncontrolled
Manage checked
prop with the help of a state for controlled Switch
and use defaultChecked
prop for uncontrolled Switch
.
Label Placement
Use labelPlacement
prop with FormControlLabel
component to change the placement of the label.
Colors
Use color
prop with Switch
component for different colored switch.
Customized Switch
Use styled
hook to customize your switch.
Sizes
Use size='small'
prop with Switch
component for small switch.
Standalone Switch