Simple Autocomplete using Material-UI
https://dccs-it-business-solutions.github.io/react-autocomplete-mui/
You should install react-autocomplete-mui with npm or yarn:
npm install @dccs/react-autocomplete-mui
or
yarn add @dccs/react-autocomplete-mui
This command will download and install react-autocomplete-mui
This package is only tested with @material-ui/[email protected]
!!
This package is based on the @material-ui/lab/Autocomplete
Uncontrolled Autocomplete with static options
<Autocomplete<any>
options={[{id:1, name:"Test 1"}, {id:2, name:"Test 2"}]}
keyProp={o => o.id}
textProp={o => o.name}
onChange={(e, v) => setValue(v)}
/>
/>
Controlled Autocomplete with options loaded async
<Autocomplete
variant="async"
value={value}
onChange={(e, v) => setValue(v)}
onLoadOptions={(query) => api.queryCountries(query)}
keyToOption={(key) => api.getCountry(key)}
keyProp={(o) => o.name}
textProp={(o) => o.name}
/>
@dccs/react-autocomplete-mui is MIT licensed