# react-search-bar

> search bar with autosuggest

Latest version **2.2.0** (published 2017-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-search-bar
pnpm add react-search-bar
yarn add react-search-bar
bun add react-search-bar
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2017-08-09 |
| First published | 2015-08-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 154 |
| Author | Vakhtang Sidamonidze |
| Maintainers | vakhtang |
| Keywords | search, search bar, autosuggest, react, react-component |

## Links

- npm: https://www.npmjs.com/package/react-search-bar
- Repository: https://github.com/vakhtang/react-search-bar
- Issues: https://github.com/vakhtang/react-search-bar/issues
- npm.io page: https://npm.io/package/react-search-bar

## Dependencies (5)

- [react](https://npm.io/package/react.md) ^15.4.0
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [lodash.omit](https://npm.io/package/lodash.omit.md) ^4.5.0
- [react-autobind](https://npm.io/package/react-autobind.md) ^1.0.6
- [lodash.debounce](https://npm.io/package/lodash.debounce.md) ^4.0.8

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.2.0 (latest) — 2017-08-09
- 2.1.1 — 2017-07-24
- 2.1.0 — 2017-06-17
- 2.0.3 — 2017-02-21
- 2.0.2 — 2017-02-13
- 2.0.1 — 2017-02-10
- 2.0.0 — 2017-02-10
- 1.1.4 — 2015-10-27
- 1.1.3 — 2015-10-19
- 1.1.2 — 2015-10-19
- 1.1.1 — 2015-10-17
- 1.1.0 — 2015-10-15
- 1.0.10 — 2015-09-20
- 1.0.9 — 2015-09-09
- 1.0.7 — 2015-08-18
- … 7 more at https://npm.io/package/react-search-bar/versions

## README

__NOTE: This library is no longer under active development. Do with it as you will. If you're looking for an alternative, please use the excellent WAI-ARIA compliant [react-autosuggest](https://github.com/moroshko/react-autosuggest) instead.__

A general-purpose search bar, built in React. View the [demo](https://vakhtang.github.io/react-search-bar).

## Development

```sh
npm start
npm run check
```

## Props

| Prop                | Type              | Required                                | Description |
| :-----------------  | :---------------- | :-------------------------------------: | :---------- |
| autoFocus           | _boolean_         |                                         | If `true`, focuses the input when the component loads |
| delay               | _number_          |                                         | The number of milliseconds to wait after the last key stroke before calling `onChange` |
| onChange            | _function_        |    &#x2713;                             | Called when input changes |
| onClear             | _function_        |    &#x2713;                             | Called when suggestions should be cleared |
| onSearch            | _function_        |    &#x2713;[<sup>1</sup>](#footnote)    | Called when clicking the search button or enter (presumes that search button is available) |
| onSelection         | _function_        |                                         | Called when selecting a suggestion |
| renderClearButton   | _boolean_         |                                         | Flag indicating whether to display the clear button |
| renderSearchButton  | _boolean_         |                                         | Flag indicating whether to display the search button |
| style               | _object_          |                                         | Style object |
| suggestionRenderer  | _function_        |                                         | Function to custom render suggestions |
| suggestions         | _array\<string>_  |    &#x2713;                             | Flat array of suggestions |

Also accepts [supported HTML attributes](https://facebook.github.io/react/docs/dom-elements.html#all-supported-html-attributes) for the `<input>` element.

<sup id="footnote">1</sup> Only when `renderSearchButton` is `true`

## License

MIT

---
_Source: https://npm.io/package/react-search-bar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
