Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import * as React from 'react';
|
|
import Radio from '@mui/material/Radio';
|
|
import RadioGroup from '@mui/material/RadioGroup';
|
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
import FormControl from '@mui/material/FormControl';
|
|
import FormLabel from '@mui/material/FormLabel';
|
|
|
|
export default function ControlledRadioButtonsGroup() {
|
|
const [value, setValue] = React.useState('female');
|
|
|
|
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
setValue((event.target as HTMLInputElement).value);
|
|
};
|
|
|
|
return (
|
|
<FormControl>
|
|
<FormLabel id="demo-controlled-radio-buttons-group">Gender</FormLabel>
|
|
<RadioGroup
|
|
aria-labelledby="demo-controlled-radio-buttons-group"
|
|
name="controlled-radio-buttons-group"
|
|
value={value}
|
|
onChange={handleChange}
|
|
>
|
|
<FormControlLabel value="female" control={<Radio />} label="Female" />
|
|
<FormControlLabel value="male" control={<Radio />} label="Male" />
|
|
</RadioGroup>
|
|
</FormControl>
|
|
);
|
|
}
|