All Projects → Greentube → ngx-typeahead

Greentube / ngx-typeahead

Licence: MIT License
Typeahead multi-select dropdown component for angular. Demo:

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ngx-typeahead

Draft Js Typeahead
Typeaheads for Draft.js inspired by Facebook.com 🔭
Stars: ✭ 117 (+431.82%)
Mutual labels:  typeahead
react-native-autocomplete-dropdown
Dropdown Item picker with search and autocomplete (typeahead) functionality for react native
Stars: ✭ 87 (+295.45%)
Mutual labels:  typeahead
bootstrap-ext
extensions to bootstrap
Stars: ✭ 18 (-18.18%)
Mutual labels:  typeahead
React Autowhatever
Accessible rendering layer for Autosuggest and Autocomplete components
Stars: ✭ 146 (+563.64%)
Mutual labels:  typeahead
Autocomplete
Blazing fast and lightweight autocomplete widget without dependencies. Only 1KB gzipped. Demo:
Stars: ✭ 244 (+1009.09%)
Mutual labels:  typeahead
indicium
🔎 A simple in-memory search for collections and key-value stores.
Stars: ✭ 41 (+86.36%)
Mutual labels:  typeahead
Autocomplete
🔮 Fast and full-featured autocomplete library
Stars: ✭ 1,268 (+5663.64%)
Mutual labels:  typeahead
extensions
Angular Material Extensions Library.
Stars: ✭ 203 (+822.73%)
Mutual labels:  typeahead
react-power-select
A highly composable & reusable select/autocomplete components
Stars: ✭ 63 (+186.36%)
Mutual labels:  typeahead
react-abstract-autocomplete
Bring-Your-Own-UI autocomplete / mentions component for React.
Stars: ✭ 15 (-31.82%)
Mutual labels:  typeahead
Autosuggest Highlight
Utilities for highlighting text in autosuggest and autocomplete components
Stars: ✭ 176 (+700%)
Mutual labels:  typeahead
Ng Select
⭐ Native angular select component
Stars: ✭ 2,781 (+12540.91%)
Mutual labels:  typeahead
Aurelia-Bootstrap-Plugins
Aurelia-Bootstrap-Plugins are Custom Elements to bridge with a set of 3rd party Bootstrap addons
Stars: ✭ 45 (+104.55%)
Mutual labels:  typeahead
React Autocomplete Hint
A React component for Autocomplete Hint.
Stars: ✭ 131 (+495.45%)
Mutual labels:  typeahead
svelte-typeahead
Accessible, fuzzy search typeahead component
Stars: ✭ 141 (+540.91%)
Mutual labels:  typeahead
React Input Enhancements
Set of enhancements for input control
Stars: ✭ 1,375 (+6150%)
Mutual labels:  typeahead
bootstrap-5-autocomplete
autocomplete/typeahead js plugin for bootstrap v5
Stars: ✭ 79 (+259.09%)
Mutual labels:  typeahead
purescript-halogen-select
Building blocks for common selection user interfaces in PureScript & Halogen
Stars: ✭ 62 (+181.82%)
Mutual labels:  typeahead
instatype
⚡️ Mobile-friendly React autocomplete component
Stars: ✭ 48 (+118.18%)
Mutual labels:  typeahead
react-thailand-address-typeahead
jquery.Thailand.js in React
Stars: ✭ 78 (+254.55%)
Mutual labels:  typeahead

ngx-typeahead

npm version Build Status Build Status

Typeahead multi-select dropdown component for angular. Demo

The version 2.x.x is for Angular 6+. If you are using older version of Angular (v2-v5) please use previous version.

Table of contents:

Installation

npm install --save ngx-type-ahead

How it works

Type ahead uses (observable) array of items to suggest value to user based on current value of the input.

Items can be simple strings or they could be objects. Here is a brief list of functionality:

  • Standard type ahead functionality
  • Custom inputs (only if suggestions are strings)
  • Fixed scope of values - limited to suggestions
  • Selecting multiple values
  • Suggestions as an array or observable of array
  • Suggestion as an object - user specifies which property is view value and which is value indentifier.

Usage

In order to use ngx-type-ahead you need to import the module and simply place component in your template.

@NgModule({
  imports: [
    TypeaheadModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
<type-ahead formControlName="myControl" [suggestions]="mySuggestions"></type-ahead>

API

DOM element properties

Type-ahead supports following properties:

  • suggestions: TypeaheadSuggestions - List or observable list of elements which represent set of possible suggestions. For more information on type check TypeaheadSuggestions.
    Default value is [].
  • itemTemplate: TemplateRef - Custom template template for items in suggestions list and badges in multi select scenario. Exposed properties are item and index.
  • custom: boolean - Flag indicating whether custom values are allowed.
    Default value is true.
  • multi: boolean - Flag indicating whether control accepts multiple values/array of values.
    Default value is false.
  • complex: boolean - Flag indicating whether suggestion represents an Object instead of simple string.
    Default value is false.
  • idField: string - Only for complex suggestions. Object's indicator property name used as a value for form component. Can be just in combination with multi, but automatically cancels custom.
    Default value is id.
  • nameField: string - Only for complex suggestions. Object's name property. This value will be shown in dropdown and in the input, but idField will be saved to form.
    Default value is name.
  • settings: TypeaheadSettings - Additional typeahead settings, mostly style related that will most likely be shared among different type-ahead elements.

TypeaheadSuggestions

Type representing suggestions. Can be:

  • string[]
  • Object[]
  • Observable<string[]>
  • Observable<Object[]>

TypeaheadSettings

export interface TypeaheadSettings {
  /** how much should be user's typing debounced */
  typeDelay: number; // Default is `50`
  /** maximal number of visible items in dropdown. If value is 0, list will not be limited */
  suggestionsLimit: number; // Default is `10`
  /** text shown when there are no matches */
  noMatchesText: string; // Default is `No matches found`

  /** css classes for parts of type-ahead */
  tagClass: string; // Default is `btn badge badge-primary`
  tagRemoveIconClass: string; // Default is ``
  dropdownMenuClass: string; // Default is `dropdown-menu`
  dropdownMenuExpandedClass: string; // Default is `dropdown-menu show`
  dropdownMenuItemClass: string; // Default is `dropdown-item`
  dropdownToggleClass: string; // Default is `dropdown-toggle`
}

License

Licensed under 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].