All Projects → gch1p → bootstrap-5-autocomplete

gch1p / bootstrap-5-autocomplete

Licence: other
autocomplete/typeahead js plugin for bootstrap v5

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to bootstrap-5-autocomplete

Zsh Autocomplete
🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
Stars: ✭ 641 (+711.39%)
Mutual labels:  autocomplete, typeahead
react-native-autocomplete-dropdown
Dropdown Item picker with search and autocomplete (typeahead) functionality for react native
Stars: ✭ 87 (+10.13%)
Mutual labels:  autocomplete, typeahead
React Autosuggest
WAI-ARIA compliant React autosuggest component
Stars: ✭ 5,773 (+7207.59%)
Mutual labels:  autocomplete, typeahead
Vue Autosuggest
🔍 Vue autosuggest component.
Stars: ✭ 492 (+522.78%)
Mutual labels:  autocomplete, typeahead
React Autowhatever
Accessible rendering layer for Autosuggest and Autocomplete components
Stars: ✭ 146 (+84.81%)
Mutual labels:  autocomplete, typeahead
Jquery Typeahead
Javascript Typeahead (autocomplete) plugin with more than 50 options and callbacks.
Stars: ✭ 527 (+567.09%)
Mutual labels:  autocomplete, typeahead
Bootstrap 4 Autocomplete
A simple autocomplete/typeahead for Bootstrap 4 and jQuery
Stars: ✭ 36 (-54.43%)
Mutual labels:  autocomplete, typeahead
autocompletex
redis autocomplete for elixir
Stars: ✭ 22 (-72.15%)
Mutual labels:  autocomplete, typeahead
React Autocomplete Hint
A React component for Autocomplete Hint.
Stars: ✭ 131 (+65.82%)
Mutual labels:  autocomplete, typeahead
React Input Enhancements
Set of enhancements for input control
Stars: ✭ 1,375 (+1640.51%)
Mutual labels:  autocomplete, typeahead
Accessible Autocomplete
An autocomplete component, built to be accessible.
Stars: ✭ 474 (+500%)
Mutual labels:  autocomplete, typeahead
Ng Select
⭐ Native angular select component
Stars: ✭ 2,781 (+3420.25%)
Mutual labels:  autocomplete, typeahead
Svelte Select
A select component for Svelte apps
Stars: ✭ 414 (+424.05%)
Mutual labels:  autocomplete, typeahead
react-power-select
A highly composable & reusable select/autocomplete components
Stars: ✭ 63 (-20.25%)
Mutual labels:  autocomplete, typeahead
Autocomplete
Accessible autocomplete component for vanilla JavaScript and Vue.
Stars: ✭ 277 (+250.63%)
Mutual labels:  autocomplete, typeahead
Autosuggest Trie
Minimalistic trie implementation for autosuggest and autocomplete components
Stars: ✭ 22 (-72.15%)
Mutual labels:  autocomplete, typeahead
vue-single-select
single select dropdown with autocomplete
Stars: ✭ 43 (-45.57%)
Mutual labels:  autocomplete, typeahead
svelecte
Selectize-like component written in Svelte, also usable as custom-element 💪⚡
Stars: ✭ 121 (+53.16%)
Mutual labels:  autocomplete, typeahead
Autocomplete
🔮 Fast and full-featured autocomplete library
Stars: ✭ 1,268 (+1505.06%)
Mutual labels:  autocomplete, typeahead
Autosuggest Highlight
Utilities for highlighting text in autosuggest and autocomplete components
Stars: ✭ 176 (+122.78%)
Mutual labels:  autocomplete, typeahead

bootstrap-5-autocomplete

This is a rewrite of https://github.com/Honatas/bootstrap-4-autocomplete for bootstrap v5.

Example

const ac = new Autocomplete(field, {
    data: [{label: "I'm a label", value: 42}],
    maximumItems: 5,
    onSelectItem: ({label, value}) => {
        console.log("user selected:", label, value);
    }
});

// later, when you need to change the dataset

ac.setData([
    {label: 'New York JFK', value: 'JFK'},
    {label: 'Moscow SVO', value: 'SVO'},
]);

Or use custom label/value keys:

const ac = new Autocomplete(field, {
    data: [{name: "entry1", text: "The first entry"}, {name: "entry2", text: "The second entry"}],
    label: "name",
    value: "text",
    onSelectItem: ({label, value}) => {
        console.log("user selected:", label, value);
    }
});

Or use a simple object instead of an array of objects:

const ac = new Autocomplete(field, {
    data: {entry1: "The first entry", entry2: "The second entry"},
    label: null,
    value: null,
    onSelectItem: ({label, value}) => {
        console.log("user selected:", label, value);
    }
});

Options

Options is a JSON object with the following attributes (in alphabetical order):

data:
The data from where autocomplete will lookup items to show. This data can be a simple object or an array of JSON objects. By default the format for every object in the array is as following, but you can also change the name of the label and value keys (see below):

{"label": "This is a text", "value": 42}

dropdownOptions:
It's the same options from Bootstrap's Dropdown, documented here.

dropdownClass:
The class of the dropdown-menu element, which is the box that is displayed. Can take a string or an array of strings.

highlightClass:
The class to use when highlighting typed text on items. Only used when highlightTyped is true. Default is text-primary. Can take a string or an array of strings.

highlightTyped:
Whether to highlight (style) typed text on items. Default is true.

label:
The name of the label key in your data. The label is what will be shown on each item in the autocomplete list.

maximumItems:
How many items you want to show when the autocomplete is displayed. Default is 5. Set to 0 to display all available items.

onInput:
A callback function to execute on user input.

onSelectItem:
A callback that is fired every time an item is selected. It receives an object in following format:

{label: <label>, value: <value>}

showValue:
If set to true, will display the value of the entry after the label in the dropdown list.

showValueBeforeLabel:
If set to true and showValue also set to true, the value will be displayed before the label.

threshold:
The number of characters that need to be typed on the input in order to trigger the autocomplete. Default is 4.

value:
The name of the value key in your data.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].