API Reference / React InstantSearch Hooks / useRangeSlider()

About this Hook

The useRangeSlider Hook isn’t currently available in React InstantSearch Hooks, but you can make it yourself using useConnector() along with connectRange.

Refer to the connectRange documentation for the full API reference.

Examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { useConnector } from 'react-instantsearch-hooks-web';
import connectRange from 'instantsearch.js/es/connectors/range/connectRange';

export function useRangeSlider(props) {
  return useConnector(connectRange, props);
}

export function RangeSlider(props) {
  const {
    start,
    range,
    canRefine,
    refine,
    sendEvent,
  } = useRangeSlider(props);

  return <>{/* Your JSX */}</>;
}
Did you find this page helpful?