Skip to content

jonolock91/manhattan-js-typeahead

 
 

Repository files navigation

Manhattan Typeahead

Type-a-head and tokens for form fields.

npm version Build Status Coverage Status dependencies status

Installation

npm install manhattan-typeahead --save-dev

Usage

<label>
    Language
    <input
        name="languages_input"
        data-mh-typeahead
        data-mh-typeahead--coerce="valueOnly"
        data-mh-typeahead--list="C,C++,CoffeeScript,JavaScript,Lua,Moonscript,Perl,Python,Wren"
        >
    <input type="hidden" name="languages">
</label>

<label>
    Tags
    <input
        name="tags_input"
        value=""
        data-mh-tokenizer
        data-mh-tokenizer--hidden-selector="[name=tags]"
        data-mh-tokenizer--sortable
        >
    <input type="hidden" name="tags">
</label>
import * as $ from 'manhattan-essentials'
import {tokenizer, typeahead} from 'manhattan-typeahead'

const myTypeahead = new typeahead.Typeahead($.one('[data-mh-typeahead]'))
myTypeahead.init()

const myTokenizer = new tokenizer.Tokenizer($.one('[data-mh-tokenizer]'))
myTokenizer.init([{'label': 'Some tag', 'value': 'Some value'}])

About

Type-a-head and tokens for form fields.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 94.7%
  • CSS 3.0%
  • HTML 2.3%