0.0.6-alpha • Published 4 years ago

@etidbury/react-suggestion-field v0.0.6-alpha

Weekly downloads
40
License
MIT
Repository
-
Last release
4 years ago

\<SuggestionField \/>

Usage

  1. Install dependency

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

    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 - 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. It outlines core values and beliefs and will make working together a happier experience.