44 lines
867 B
JavaScript
44 lines
867 B
JavaScript
import React from "react";
|
|
import Card from "@mui/material/Card";
|
|
import { Typography } from "@mui/material";
|
|
import Switch from '@mui/material/Switch';
|
|
|
|
export default function Controlled() {
|
|
|
|
const [checked, setChecked] = React.useState(true);
|
|
|
|
const handleChange = (event) => {
|
|
setChecked(event.target.checked);
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<Card
|
|
sx={{
|
|
boxShadow: "none",
|
|
borderRadius: "10px",
|
|
p: "25px",
|
|
mb: "15px",
|
|
}}
|
|
>
|
|
<Typography
|
|
as="h3"
|
|
sx={{
|
|
fontSize: 18,
|
|
fontWeight: 500,
|
|
mb: '10px'
|
|
}}
|
|
>
|
|
Controlled
|
|
</Typography>
|
|
|
|
<Switch
|
|
checked={checked}
|
|
onChange={handleChange}
|
|
inputProps={{ 'aria-label': 'controlled' }}
|
|
/>
|
|
</Card>
|
|
</>
|
|
);
|
|
}
|