19 lines
409 B
JavaScript
19 lines
409 B
JavaScript
|
|
import * as React from 'react';
|
||
|
|
import Switch from '@mui/material/Switch';
|
||
|
|
|
||
|
|
export default function ControlledSwitches() {
|
||
|
|
const [checked, setChecked] = React.useState(true);
|
||
|
|
|
||
|
|
const handleChange = (event) => {
|
||
|
|
setChecked(event.target.checked);
|
||
|
|
};
|
||
|
|
|
||
|
|
return (
|
||
|
|
<Switch
|
||
|
|
checked={checked}
|
||
|
|
onChange={handleChange}
|
||
|
|
slotProps={{ input: { 'aria-label': 'controlled' } }}
|
||
|
|
/>
|
||
|
|
);
|
||
|
|
}
|