Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-instantsearch-core
Advanced tools
react-instantsearch-core is a library that provides a set of React components and connectors to build search interfaces using Algolia's search engine. It allows developers to create highly customizable and performant search experiences in their React applications.
SearchBox
The SearchBox component provides a search input field that users can type into to perform searches. It is a core component for capturing user queries.
import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-core';
const App = () => (
<InstantSearch
indexName="your_index_name"
searchClient={algoliaClient}
>
<SearchBox />
<Hits />
</InstantSearch>
);
Hits
The Hits component is used to display the search results. You can customize how each hit (search result) is rendered by providing a custom hitComponent.
import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-core';
const Hit = ({ hit }) => (
<div>
<h2>{hit.title}</h2>
<p>{hit.description}</p>
</div>
);
const App = () => (
<InstantSearch
indexName="your_index_name"
searchClient={algoliaClient}
>
<SearchBox />
<Hits hitComponent={Hit} />
</InstantSearch>
);
RefinementList
The RefinementList component allows users to filter search results based on specific attributes, such as categories. It provides a list of checkboxes for users to refine their search.
import { InstantSearch, SearchBox, Hits, RefinementList } from 'react-instantsearch-core';
const App = () => (
<InstantSearch
indexName="your_index_name"
searchClient={algoliaClient}
>
<SearchBox />
<RefinementList attribute="categories" />
<Hits />
</InstantSearch>
);
Pagination
The Pagination component provides pagination controls to navigate through search results. It is useful for handling large sets of search results by breaking them into pages.
import { InstantSearch, SearchBox, Hits, Pagination } from 'react-instantsearch-core';
const App = () => (
<InstantSearch
indexName="your_index_name"
searchClient={algoliaClient}
>
<SearchBox />
<Hits />
<Pagination />
</InstantSearch>
);
react-searchkit is a library for building search interfaces with React. It is designed to work with Invenio, a framework for large-scale digital repositories. Compared to react-instantsearch-core, react-searchkit is more tailored towards specific use cases involving digital repositories and may not offer the same level of flexibility for general search applications.
react-instantsearch-dom is another library from Algolia that provides a set of React components for building search interfaces. It is similar to react-instantsearch-core but is more focused on DOM-specific components, making it easier to use for web applications. It offers a higher-level API compared to react-instantsearch-core.
React InstantSearch Core is an open-source UI library for React that lets you quickly build a search interface in your front-end application.
InstantSearch’s goal is to help you implement awesome search experiences as smoothly as possible by providing a complete search ecosystem. InstantSearch tackles an important part of this vast goal by providing front-end primitives that you can assemble into unique search interfaces.
Note:
react-instantsearch-core
exports renderless components and hooks which can be used for both web and React Native. If you are using React in a web project, we recommend using the packagereact-instantsearch
instead, as it includes complete components that render to the DOM.
React InstantSearch Core is available on the npm registry. It relies on algoliasearch
to communicate with Algolia APIs.
yarn add algoliasearch react-instantsearch-core
# or
npm install algoliasearch react-instantsearch-core
React InstantSearch Core is a headless React library that lets you create an instant search results experience using Algolia’s search API.
Check out our Getting Started guide to start implementing a full-featured search experience with React InstantSearch Core.
Check out the API reference.
The documentation is available on algolia.com/doc.
We welcome all contributors, from casual to regular 💙
To start contributing to code, you need to:
yarn
Please read our contribution process to learn more.
React InstantSearch is MIT licensed.
FAQs
⚡ Lightning-fast search for React, by Algolia
We found that react-instantsearch-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.