Switch
An on and off switch for a setting, with its label.
Add it to your project
Or install the packages yourselfTerminal
npm install @mui/material
First time with Material UI? Set it up once.
The code
'use client';
import FormGroup from '@mui/material/FormGroup';
import FormControlLabel from '@mui/material/FormControlLabel';
import Switch from '@mui/material/Switch';
export default function SwitchLabels() {
return (
<FormGroup>
<FormControlLabel control={<Switch defaultChecked />} label="Label" />
<FormControlLabel required control={<Switch />} label="Required" />
<FormControlLabel disabled control={<Switch />} label="Disabled" />
</FormGroup>This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.