2.0.0 • Published 4 years ago

haystack-ui v2.0.0

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

Haystack UI

npm npm

Overview

Haystack UI is a React component that allows you to easily insert a search field into your website. It's based on the functionality of fuzzy-search plugin Haystack, but with a built-in interface.

Installation

Using npm:

npm i haystack-ui

Import Haystack UI component:

import { HaystackUI } from 'haystack-ui';

Render component:

<HaystackUI <options> />

Props

Haystack UI options

Required:

OptionDefaultDescription
source (array)nullPool of data to pull suggestions from

Optional:

OptionDefaultDescription
theme (string)lightColor scheme ("light", "dark", or "ghost")
placeholder (string)"Search"Input placeholder text
showSuggestions (boolean)trueWhether or not to show suggestion drop-down
inlineSuggestions (boolean)falseDisplays an autocompleted suggestion on the same line as input
suggestionLimit (number)4Maximum number of suggestions shown in drop-down
submitLocation (string)"#"URL of the file that will process GET method. Your search string will be received as "query"
caseSensitive (boolean)falseWhether or not search is case sensitive
flexibility (number)1"Fuzziness" of suggestions. The lower the number, the more strict your suggestions will be
stemming (boolean)falseReduces tokens in a query to their base words
exclusions (string)nullAdd a string or regex to ignore in query
ignoreStopWords booleanfalseIgnore common stop words such as the, a, in, etc.

License

MIT

2.0.0

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago