material-ui select code example
Example 1: material ui select element inside class
shopForm: {
textAlign : 'center',
'& input' :{
width: '60%',
color:'grey'
},
'& label':{
fontSize:'15px'
}
Example 2: how to set dynamic autocomplete with material ui
import React, { useState } from 'react';
using useState:
const [val,setVal]=useState({})
changin value on click of button
const handleClick = () => {
setVal(top100Films[0]);
};
and pass this value to component in render
<Autocomplete
value={val}
options={top100Films}
getOptionLabel={option => option.title}
style={{ width: 300 }}
renderInput={params => (
<TextField
{...params}
label="Combo box"
variant="outlined"
fullWidth
/>
)}
/>