
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
react-structured-query-search-suggestions
Advanced tools
react-structured-query-search with the provision to load incremental suggestions from the rest api
react-structured-query-search-suggestions is a javascript library that provides autocomplete search queries with dynamic/static suggestions. This was inspired by visualsearch, react-structured-filter and react-structured-query-search.
This plugin is written on top of react-structured-filter, which has been revamped to add React 16 support and the existing code has been overriden to support New features.
You can use all the react-typeahead, react-structured-filter API(options) as they are.
Array<String> or Array<Object>npm install --save react-structured-query-search-suggestions
If you want to use Tokenizer then you either import as follows:
import ReactStructuredQuerySearch from "react-structured-query-search-suggestions";
import "react-structured-query-search-suggestions/dist/index.css";
import {Tokenizer} from "react-structured-query-search-suggestions";
import "react-structured-query-search-suggestions/dist/index.css";
If you want to use Typeahead then you have to import as follows:
import {Typeahead} from "react-structured-query-search-suggestions";
import "react-structured-query-search-suggestions/dist/index.css";
| Parameter | Type | Default | Description |
|---|---|---|---|
| options | Array | [] | An array supplied to the filter function. |
| maxVisible | Number | Limit the number of options rendered in the results list. | |
| customClasses | Object | Allowed Keys:
An object containing custom class names for child elements. Useful for integrating with 3rd party UI kits. | |
| placeholder | String | Placeholder text for the typeahead input. | |
| :new: disabled | Boolean | false | Set to true for disabling the StructureQuerySearch |
| :new: defaultSelected | function, Array | [] | Allows user to initialize the search with selected values (Include isAllowFreeSearch:true in the free search term selected option) |
| :new: categoryHeader | String, Component | "Category" | Allows user the change the header title of Category |
| :new: operatorHeader | String, Component | "Operator" | Allows user the change the header title of Operator |
| :new: valueHeader | String, Component | "Value" | Allows user the change the header title of Value |
| :new: isAllowSearchDropDownHeader | Boolean | "true" | Allows user to enable/disable search drop-down header |
| :new: isAllowOperator | Boolean | false | Allows user to enable/disable operators in search |
| :new: isAllowClearAll | Boolean | true | Allows user to clear all selected data |
| onTokenRemove | Function | Event handler triggered whenever a token is removed. | |
| onTokenAdd | Function | Event handler triggered whenever a token is added. Params: (addedToken) | |
| :new: onClearAll | function | Event handler triggered whenever clear all button clicked | |
| onOptionSelected | Function | Event handler triggered whenever a user picks an option. | |
| :new: updateOptions | function | Allows user to update the Options(props) at runtime, this function is called before onTokenRemove and onTokenAdd | |
| :new: fuzzySearchEmptyMessage | String | "No result found" | This message is shown when dropdown doesn't have search value |
| :new: renderLoading | function, Component | "Loading...." | Show custom loader when values are retrieved using Ajax |
| :new: renderTokens | function | Allows user to render custome Token Component | |
| :new: renderTokenItem | function | Allows user to render custome Token Item | |
| :new: renderSearchItem | function | Allows user to render custome value | |
| :new: fetchData | function | [] | Allows user to fetch dynamic suggestions(options). (Required if any of the options has type:"textoptions" and dynamicOptions:true) |
| onKeyDown | Function | Event handler for the keyDown event on the typeahead input. | |
| onKeyPress | Function | Event handler for the keyPress event on the typeahead input. | |
| onKeyUp | Function | Event handler for the keyUp event on the typeahead input. | |
| onBlur | Function | Event handler for the blur event on the typeahead input. | |
| onFocus | Function | Event handler for the focus event on the typeahead input. |
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| category | String | required | Name of the first thing the user types. | |
| type | String | text | This can be one of the following:
| |
| :new: operator | Array, function | required, if isAllowOperator prop is set to true | If this attribute is added then it would ignore the type check as described in type parameter and it would accept what you have passed | |
| options | Array | required, if type="textoptions" | Get the value according to selected category | |
| dynamicOptions | Boolean | false | A boolean which if set to true, dynamic search suggestions(options) will be loaded using fetchData function. If set to false, static options will be served | |
| :new: isAllowCustomValue | Boolean | false | When this parameter is set to true, it allows you to send multiple custom values for type=textoptions | |
| :new: isAllowDuplicateCategories | Boolean | true | Switch between unique/duplicate categories (key) | |
| :new: isAllowDuplicateOptions | Boolean | false | Switch between unique/duplicate values | |
| :new: fuzzySearchKeyAttribute | String | name | If Category (options)values are Array<Object> then By default fuzzy search look for name attribute inside options(values) but you can change that attribut lookup key using fuzzySearchKeyAttribute |
Please run npm install in the root and example folders. then do the following:
npm start after thisnpm run link (only for first time)npm start it would run the plugin from link which we have created.Now, anytime you make a change to your library in src/ or to the example app's example/src create-react-app will live-reload your local dev server so you can iterate on your component in real-time.
MIT
FAQs
react-structured-query-search with the provision to load incremental suggestions from the rest api
The npm package react-structured-query-search-suggestions receives a total of 7 weekly downloads. As such, react-structured-query-search-suggestions popularity was classified as not popular.
We found that react-structured-query-search-suggestions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.