Widgets ScrollTo

Description

The ScrollTo component will make the page scroll to the component wrapped by it when one of the search state prop is updated. By default when the page number changes, the scroll goes to the wrapped component.

Props

scrollOn
type: stringdefault: "page"

Widget state key on which to listen for changes.

Example usage

import React from 'react'; import { InstantSearch, ScrollTo, Hits } from 'react-instantsearch-dom'; const App = () => ( <InstantSearch appId="latency" apiKey="6be0576ff61c053d5f9a3225e2a90f76" indexName="instant_search" > <ScrollTo> <Hits /> </ScrollTo> </InstantSearch> );

CSS classes

.ais-ScrollTo {}

the root div of the widget

Translation keys

This widget has no translations.