Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
react-search-box
Advanced tools
# npm
npm i react-search-box --save
# yarn
yarn add react-search-box
import React, { Component } from "react";
import ReactSearchBox from "react-search-box";
export default class App extends Component {
data = [
{
key: "john",
value: "John Doe",
},
{
key: "jane",
value: "Jane Doe",
},
{
key: "mary",
value: "Mary Phillips",
},
{
key: "robert",
value: "Robert",
},
{
key: "karius",
value: "Karius",
},
];
render() {
return (
<ReactSearchBox
placeholder="Placeholder"
value="Doe"
data={this.data}
callback={(record) => console.log(record)}
/>
);
}
}
Prop | Description |
---|---|
placeholder | The placeholder text for the input box |
data | An array of objects which acts as the source of data for the dropdown. This prop is required |
fuseConfigs | Configs to override default Fuse configs |
autoFocus | Focus on the input box once the component is mounted |
clearOnSelect | Clear the input value when any record is selected |
onSelect | A function which acts as a callback when any record is selected. It is triggered once a dropdown item is clicked |
onFocus | A function which acts as a callback when the input is focussed |
onChange | A function which acts as a callback when the input value is changed |
inputFontColor | Color of the text in the input box |
inputBorderColor | Color of the border of the input box |
inputFontSize | Size of the font of the input box |
inputHeight | Height of the input box |
inputBackgroundColor | Background color of the input box |
dropDownHoverColor | Background color on hover of the dropdown list items |
dropDownBorderColor | Border color of the dropdown |
leftIcon | Icon to be rendered on the left of the input box |
iconBoxSize | The size of the icon (based on the leftIcon prop) |
type | The type of the input |
MIT Licensed. Copyright (c) Nirmalya Ghosh 2021.
FAQs
An autocomplete search box for ReactJS
The npm package react-search-box receives a total of 1,454 weekly downloads. As such, react-search-box popularity was classified as popular.
We found that react-search-box demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.