Banners
On this page
We released React InstantSearch Hooks, a new InstantSearch library for React. We recommend using React InstantSearch Hooks in new projects or upgrading from React InstantSearch.
The Banners
component allows you to display banners using Rules. With Rules, you can return custom data when certain conditions are met. For example,
you can return custom data when the current category is “Women”, as shown in the following example. With this Rule, the “Banners” component displays a banner with the props coming from your Rule’s custom data.
Code summary
You can customize Banners
in:
- The product listing page
- The
Banners
file - Its props.
Usage and props
1
<Banners limit={1} />
External packages used
The Banners
component depends on these npm packages:
jotai
: the state management library (written in TypeScript).classnames
: a utility for conditionally joining CSS class names.react-instantsearch-dom
: a package that provides the connectorconnectQueryRules
that passes an item’s array that matches a Rule.