Skip to content

Commit

Permalink
added demo source code in tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-ngchakming committed Mar 30, 2022
1 parent 2e9e284 commit 2a79194
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docs/data/material/components/selects/SelectSmall.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import * as React from 'react';
import InputLabel from '@mui/material/InputLabel';
import MenuItem from '@mui/material/MenuItem';
import FormControl from '@mui/material/FormControl';
import Select, { SelectChangeEvent } from '@mui/material/Select';

export default function SelectSmall() {
const [age, setAge] = React.useState('');

const handleChange = (event: SelectChangeEvent) => {
setAge(event.target.value);
};

return (
<FormControl sx={{ m: 1, minWidth: 120 }} size="small">
<InputLabel id="demo-simple-select-disabled-label">Age</InputLabel>
<Select
labelId="demo-select-small"
id="demo-select-small"
value={age}
label="Age"
onChange={handleChange}
>
<MenuItem value="">
<em>None</em>
</MenuItem>
<MenuItem value={10}>Ten</MenuItem>
<MenuItem value={20}>Twenty</MenuItem>
<MenuItem value={30}>Thirty</MenuItem>
</Select>
</FormControl>
);
}

0 comments on commit 2a79194

Please sign in to comment.