# react-searchbox-highlight

> React Searchbox Highlight

Latest version **1.0.5** (published 2020-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-searchbox-highlight
pnpm add react-searchbox-highlight
yarn add react-searchbox-highlight
bun add react-searchbox-highlight
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2020-09-25 |
| First published | 2020-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 731.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | yuriburk |

## Links

- npm: https://www.npmjs.com/package/react-searchbox-highlight
- Repository: https://github.com/yuriburk/react-searchbox-highlight
- Homepage: https://github.com/yuriburk/react-searchbox-highlight#readme
- Issues: https://github.com/yuriburk/react-searchbox-highlight/issues
- npm.io page: https://npm.io/package/react-searchbox-highlight

## Dependencies (8)

- [react-icons](https://npm.io/package/react-icons.md) ^3.11.0
- [lodash.debounce](https://npm.io/package/lodash.debounce.md) ^4.0.8
- [styled-components](https://npm.io/package/styled-components.md) ^5.2.0
- [@types/react-icons](https://npm.io/package/@types/react-icons.md) ^3.0.0
- [react-highlight-words](https://npm.io/package/react-highlight-words.md) ^0.16.0
- [@types/lodash.debounce](https://npm.io/package/@types/lodash.debounce.md) ^4.0.6
- [@types/styled-components](https://npm.io/package/@types/styled-components.md) ^5.1.3
- [@types/react-highlight-words](https://npm.io/package/@types/react-highlight-words.md) ^0.16.1

## Recent versions

- 1.0.5 (latest) — 2020-09-25
- 1.0.4 — 2020-09-25
- 1.0.3 — 2020-09-25
- 1.0.1 — 2020-09-25

## README

<h1>React Searchbox Highlight</h1>

![SearchBox gif](https://i.imgur.com/MQJXzv5.gif)

This is a easy searchbox component ready to use with highlight and loading features.

<h2>Example Usage</h2>

```js
import SearchBox from 'react-searchbox-highlight';

<SearchBox
  items={[
    { label: 'Object 1', value: { name: 'obj1' } },
    { label: 'Object 2', value: { name: 'obj2' } },
  ]}
  onChange={(value) => handleChange(value)}
  onItemClick={(value) => handleOpenItem(value)}
/>;
```

<h2>Properties</h2>
<table class="tg">
<thead>
  <tr>
    <th class="tg-0pky">Name</th>
    <th class="tg-0pky">Type</th>
    <th class="tg-0lax">Usage</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td class="tg-0pky">items</td>
    <td class="tg-0pky">{ label: string; value: unknown }[]</td>
    <td class="tg-0lax">Will be used to create the list of items below the searchbox</td>
  </tr>
  <tr>
    <td class="tg-0pky">onChange</td>
    <td class="tg-0pky">void</td>
    <td class="tg-0lax">Will fire an event with the typed text that you can use to manipulate the items values or do side effects</td>
  </tr>
  <tr>
    <td class="tg-0pky">onItemClick</td>
    <td class="tg-0pky">void</td>
    <td class="tg-0lax">Will fire an event with the value of the clicked item</td>
  </tr>
  <tr>
    <td class="tg-0pky">debounceTime</td>
    <td class="tg-0pky">number</td>
    <td class="tg-0lax">Will be used to change the value of the debounced change event. Default: 200 (ms).</td>
  </tr>
  <tr>
    <td class="tg-0lax">placeholder</td>
    <td class="tg-0lax">string</td>
    <td class="tg-0lax">Will be shown in the input placeholder. Default: Search...</td>
  </tr>
   <tr>
    <td class="tg-0lax">highlighterStyle</td>
    <td class="tg-0lax">Record&lt;string, unknown&gt;</td>
    <td class="tg-0lax">Will apply custom style to the highlight component. Default: { color: '#fff', backgroundColor: '#9999ff' }</td>
  </tr>
</tbody>
</table>

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