Coder Social home page Coder Social logo

react-search-bar's Introduction

react-search-bar

A search bar with autosuggest, built in React.

Installation

npm install react-search-bar --save

Demo

View the demo online.

Alternatively, run it locally:

npm install
npm run demo

Then visit localhost:5000.

Usage

<SearchBar
  onChange={(input, resolve) => {
    // get suggestions based on `input`, then pass them to `resolve()`
  }} />

You must supply a callback to the onChange event handler to populate suggestions. A callback to the onSubmit event handler is optional.

Props

autoFocus

type: boolean

indicates whether the component should take focus on page load

debounceDelay

type: number

the number of milliseconds to wait after the last key stroke before performing autosuggest

inputName

type: string

sets the name attribute on the input field

onChange

type: function

callback that executes on input and populates suggestions

onSubmit

type: function

callback that executes on search submit (overrides default form submit)

placeholder

type: string

sets the placeholder attribute on the input field

License

MIT

react-search-bar's People

Contributors

vakhtang avatar nov1n avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.