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