
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
search-reactjs
Advanced tools
Search-reactjs component allows the search or filter of objects by specifying a search criteria according to the properties of the object, providing flexibility to the developer at the time of implementation and allowing the fulfillment of the requested requirements.
The component displays an input text where the user enters the value they want to search for, it also displays the button to start the search action. This component also allows to perform the search automatically while the user enters the text in the input.
To install the component use the Node Package Manager (npm). You must open the command console at the root of your project and execute the command:
npm install search-reactjs --save
Click me to go to the demo on codeSandbox!
Here is an example of how to implement the component:
import logo from './logo.svg';
import './App.css';
import SearchReact from 'search-reactjs';
function App() {
const users = [
{
name:'marvin',
home:{
location:'Heredia',
local:{
number: 3
}
}
},
{
name:'Jose',
home:{
location:'Puntarenas',
local:{
number: 5
}
}
},
{
name:'Mario',
home:{
location:'Cartago',
local:{
number: 1
}
}
},
{
name:'Luna',
home:{
location:'San Jose',
local:{
number: 2
}
}
},
];
let callBack = (result)=>{
console.log('result',result);
}
return (
<div className="App">
<header className="App-header">
<h1>Search Component</h1>
<img src={logo} className="App-logo" alt="logo" />
<h2>search-react</h2>
<br/>
<SearchReact
listObjects={users}
btnName={'Search'}
placeholder={"Search by name"}
borderRadius={'2px'}
fontSize={'17px'}
searchCriteria={'name'}
btnHoverBackground={'red'}
btnHoverTextColor={''}
hideButton={false}
callBack={callBack}
/>
</header>
</div>
);
}
export default App;
Props for component styles are displayed as a table with Name, Type, Default, and Description as headings.
Required props are marked with *
.
Name | Type | Default | Description |
---|---|---|---|
inputColor | string | blue | Indicates the text color for the input text element. |
inputWidth | string | 200px | Indicates the width for the input text element. |
placeholder | string | Serach | Indicates the placeholder for the input text element. |
height | string | 30px | Indicates the height for the input text element and the button element. |
borderRadius | string | 5px | Indicates the border radius for the input text element and the button element. |
fontSize | string | | Indicates the text size for the input text element and the button element. |
btnColor | string | black | Indicates the text color for the button element. |
btnWidth | string | 100px | Indicates the width for the button element. |
btnBorder | string | 2px solid #61DAFB | Indicates the border for the button element. |
btnHoverBackground | string | #3dbadc | Indicates the background color for hover the button element. |
btnHoverTextColor | string | #ffff | Indicates the text color for hover the button element. |
btnName | string | Serach | Indicates the name for the button element. |
Additional information about using the component pros.
Props for component functionality are displayed as a table with Name, Type, Default, and Description as headers.
Required props are marked with *
.
Name | Type | Default | Description |
---|---|---|---|
hideButton | bool | false | Indicates if the search button will be shown. |
searchCriteria * | string | | Specify the search criteria. |
listObjects * | array | | Array of objects to be filtered. |
callBack * | function | | Function that will receive array of filtered objects. |
Additional information about using the component pros.
//List objects
const users = [
{
name:'marvin',
home:{
location:'Heredia',
local:{
number: 3
}
}
},
{
name:'Jose',
home:{
location:'Puntarenas',
local:{
number: 5
}
}
}
]
//Possible criteria
<SearchReact listObjects={users} searchCriteria={'name'} />
or
<SearchReact listObjects={users} searchCriteria={'home.location'} />
or
<SearchReact listObjects={users} searchCriteria={'home.local.number'} />
People who helped build the project from its inception
This project is licensed under the ISC License - see the file LICENSE.md for details.
FAQs
Search Component
The npm package search-reactjs receives a total of 8 weekly downloads. As such, search-reactjs popularity was classified as not popular.
We found that search-reactjs 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.