1.0.4 • Published 8 years ago
remontant v1.0.4
remontant
Simple React.js autocomplete with themes for Bootstrap, Materialize and Foundation.
Installation
Using npm:
$ npm i --save remontant
In Node.js:
var Autocomplete = require('remontant');
Usage
API
callback(value, _this)
: This is the only required prop. It is essentially the function that will be callbacked everytime a key is pressed. This is where you will put your ajax or whatever will drive your result data.onSelect
: A callback function when a value is selected.minChars
: Minimum character required to trigger an autocomplete.theme
: Theme of your autocompleter: Bootstrap, Materialize or Foundation.
Example
Additional properties to the API above will be added to the input at attributes.
<Autocomplete callback={ (v, _this) => _this.setState({items: ['array', 'of', 'strings']}) }
theme="materialize"
placeholder="Search"/>