import * as React from 'react'; import FormControl from '@mui/joy/FormControl'; import FormLabel from '@mui/joy/FormLabel'; import FormHelperText from '@mui/joy/FormHelperText'; import Switch from '@mui/joy/Switch'; export default function SwitchControl() { const [checked, setChecked] = React.useState(false); return (
Show captions All languages available.
setChecked(event.target.checked)} color={checked ? 'success' : 'neutral'} variant={checked ? 'solid' : 'outlined'} endDecorator={checked ? 'On' : 'Off'} slotProps={{ endDecorator: { sx: { minWidth: 24, }, }, }} />
); }