# @etidbury/react-suggestion-field

Latest version **0.0.6-alpha** (published 2020-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @etidbury/react-suggestion-field
pnpm add @etidbury/react-suggestion-field
yarn add @etidbury/react-suggestion-field
bun add @etidbury/react-suggestion-field
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6-alpha |
| Published | 2020-09-22 |
| First published | 2020-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 21 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Edward Tidbury |
| Maintainers | etidbury |

## Links

- npm: https://www.npmjs.com/package/@etidbury/react-suggestion-field
- npm.io page: https://npm.io/package/@etidbury/react-suggestion-field

## Dependencies (1)

- [react-autosuggest](https://npm.io/package/react-autosuggest.md) ^10.0.2

## Recent versions

- 0.0.6-alpha (latest) — 2020-09-22
- 0.0.5-alpha — 2020-09-22
- 0.0.4-alpha — 2020-05-16
- 0.0.3-alpha — 2020-05-16
- 0.0.2-alpha — 2020-05-16
- 0.0.1 — 2020-05-15

## README

# \<SuggestionField \/\>

<a href="https://react-suggestion-field.now.sh/" target="_blank"><img src="https://raw.githubusercontent.com/storybooks/brand/master/badge/badge-storybook.svg"></a>


# Usage

1. Install dependency
    ```bash
    yarn add @etidbury/react-suggestion-field

    npm install @etidbury/react-suggestion-field
    ```
2. Add to your project

    ```jsx
    import SuggestionField from '@etidbury/react-suggestion-field'

    //...

    <SuggestionField<{title:string}>
        searchSuggestions={async (searchValue: string) => {

            //simulate load delay
            await new Promise((r) => setTimeout(r, 500))

            return [
                {title:"red"},
                {title:"blue"}
            ].filter(({ title }) => title.includes(searchValue))

        }}
    />
    ```




# License

This code is released under the [MIT license](LICENSE.md) - feel free to use it.

# Contribute

1. Fork or clone this repository
2. If using VS Code, install recommended extensions
3. `yarn install`
4. `yarn start`

## `yarn` Scripts
- `test` - _run unit tests_
- `test:cover` - _run unit tests with test coverage_
- `lint` - _check `eslint` and `prettier` rules_
- `lint:fix` - _autofix unmet `eslint` and `prettier` rules_
- `local-pack` - _create the `tgz` package locally to test consumers without publishing_
- `start` - _start the storybook server and automatically open in browser_
- `compile` - _standard typescript compile `tsc`_
- `now-build` - _used by Zeit when building your storybook for deployment (do not rename this script)_

Before each commit, `husky` and `lint-staged` will automatically lint your staged `ts, tsx, js, jsx` files.

Please contribute any improvements or fixes to this project!

To make sure you have a pleasant experience, please read the [code of conduct](CODE_OF_CONDUCT.md). It outlines core values and beliefs and will make working together a happier experience.

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