A web component for choosing a value from a filterable list of options presented in an overlay.
<logo-elements-combo-box
label="User"
placeholder="Please select"
item-value-path="email"
item-label-path="email"
></logo-elements-combo-box>
<script>
const comboBox = document.querySelector('logo-elements-combo-box');
fetch('https://randomuser.me/api?results=100&inc=name,email')
.then((res) => res.json())
.then((json) => (comboBox.items = json.results));
</script>
Install the component:
npm i @logo-elements/combo-box
Once installed, import the component in your application:
import '@logo-elements/combo-box';