# react-searchable-component

> React component for searching through a list of items

Latest version **1.1.9** (published 2022-09-05) · 0 weekly downloads

## Install

```sh
npm install react-searchable-component
pnpm add react-searchable-component
yarn add react-searchable-component
bun add react-searchable-component
```

## 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.1.9 |
| Published | 2022-09-05 |
| First published | 2022-09-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | arxlan99 |
| Keywords | react, search, searchable, component, list, filter |

## Links

- npm: https://www.npmjs.com/package/react-searchable-component
- npm.io page: https://npm.io/package/react-searchable-component

## Dependencies (9)

- [react](https://npm.io/package/react.md) ^18.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.8.1
- [web-vitals](https://npm.io/package/web-vitals.md) ^2.1.4
- [react-scripts](https://npm.io/package/react-scripts.md) 5.0.1
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.12.1
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^13.3.0
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^5.16.5
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^13.5.0

## 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

- 1.1.9 (latest) — 2022-09-05
- 1.1.8 — 2022-09-05
- 1.1.7 — 2022-09-05
- 1.1.6 — 2022-09-05
- 1.1.5 — 2022-09-05
- 1.1.4 — 2022-09-05
- 1.1.3 — 2022-09-05
- 1.1.2 — 2022-09-05
- 1.1.1 — 2022-09-05
- 1.1.0 — 2022-09-05
- 1.0.9 — 2022-09-05
- 1.0.8 — 2022-09-05
- 1.0.7 — 2022-09-05
- 1.0.6 — 2022-09-05
- 1.0.5 — 2022-09-05
- … 5 more at https://npm.io/package/react-searchable-component/versions

## README

# react-searchable-component

> Simple [React](http://facebook.github.io/react/index.html) component for a search input, providing a filter function.

### [Demo](https://searchable-box.vercel.app/)

## Install

```bash
npm install react-searchable-component
```

## Example

```javascript
import React, { useState } from 'react';
import { SearchableBox, BoxItem } from 'react-searchable-component';

function App() {
  const array = [
    {
      id: 1,
      name: 'Youtube',
      imageUrl: 'https://www.youtube.com/favicon.ico',
    },
    {
      id: 2,
      name: 'Facebook',
      imageUrl: 'https://www.facebook.com/favicon.ico',
    },
    {
      id: 3,
      name: 'Twitter',
      imageUrl: 'https://www.twitter.com/favicon.ico',
    },
    {
      id: 4,
      name: 'Instagram',
      imageUrl: 'https://www.instagram.com/favicon.ico',
    },
    {
      id: 5,
      name: 'Reddit',
      imageUrl: 'https://www.reddit.com/favicon.ico',
    },
  ];

  const [theme, setTheme] = useState(false);
  const [isAlwaysOpen, setIsAlwaysOpen] = useState(true);
  const [title, setTitle] = useState('Type to search');

  return (
    <div>
      <SearchableBox
        darkTheme={theme}
        placeholder
        title={title}
        items={array}
        alwaysOpen={isAlwaysOpen}
      >
        {(items) =>
          items.map((item, index) => (
            <BoxItem key={index}>
              <div>
                <img src={item.imageUrl} alt="" width={22} />
              </div>
              <div>{item.name}</div>
            </BoxItem>
          ))
        }
      </SearchableBox>
    </div>
  );
}

export default App;

```

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