This is the React InstantSearch v7 documentation.
If you’re upgrading from v6, see the upgrade guide.
If you were using React InstantSearch Hooks,
this v7 documentation applies—just check for necessary changes.
To continue using v6, you can find the archived documentation.
Signature
Import
JavaScript
About this widget
<PoweredBy>
is a widget that lets you display the Algolia logo to redirect to the Algolia website.
Algolia requires that you display a
“Search by Algolia” logo with a link if you’re on a community plan
(open source, not-for-profit, or DocSearch).
You can also create your own UI with
usePoweredBy
.Examples
JavaScript
Props
The version of the logo to use, legible on light or dark backgrounds.
JavaScript
The CSS classes you can override and pass to the widget’s elements.
It’s useful to style widgets with class-based CSS frameworks like Bootstrap or Tailwind CSS.
root
. The root element of the widget.light
. The root element of the widget with the light theme.dark
. The root element of the widget with the dark theme.link
. The link element.logo
. The SVG logo.
JavaScript
Any
<div>
prop to forward to the root element of the widget.JavaScript
Hook
React InstantSearch let you create your own UI for the<PoweredBy>
widget with usePoweredBy
.
Hooks provide APIs to access the widget state and interact with InstantSearch.
The usePoweredBy
Hook returns APIs.
Usage
First, create your React component:JavaScript
JavaScript
APIs
Hooks return APIs, such as state and functions. You can use them to build your UI and interact with React InstantSearch.The URL to redirect to.
Example
JavaScript