Files
react-test/docs/data/material/components/switches/ControlledSwitches.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
409 B
JavaScript
Raw Normal View History

2025-12-12 14:26:25 +09:00
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' } }}
/>
);
}