/react-search-box

:mag: An autocomplete search box for ReactJS

Primary LanguageJavaScriptMIT LicenseMIT

React-Search-Box

An autocomplete search box built with and for React.

Demo & Examples

Demo

React-Search-Box

Clone this repo then run:

cd example
npm install
npm start

Then open localhost:3000 in a browser.

Installation

The easiest way to use React-Search-Box is to install it from NPM and include it in your own React build process (using Browserify, etc).

npm install react-search-box --save

At this point you can import react-search-box and its styles in your application as follows:

import Search from "react-search-box";

Usage

React-Search-Box can also listen for changes with the onChange event property.

The 'data' property should be provided as an Array. The placeholder property of each option should be set to either a string or a number. The searchKey property of each option should be set to either a string or a number. It is the key that the search box will use for while iterating over your array of objects.

Have a look at the example/src/app.js file for more details.

Custom classNames

You can provide a custom class prop to the <Search> component, for custom styling.

Contributing

All sorts of contributions are welcome.

License

MIT Licensed. Copyright (c) Nirmalya Ghosh 2018.