The identifier for the specific range facet.
An object containing range information and functions to update the range.
Max value
Min value
Range value
Update range function
General usage with useRange
:
import { useRange } from "@nosto/search-js/preact";
import { useState } from "react";
const Component = ({ facetId }) => {
const { min, max, range, updateRange } = useRange(facetId);
return (
<div>
Current Range: {range[0]} to {range[1]}
<button onClick={() => updateRange([min, max])}>Reset Range</button>
</div>
);
};
A hook that returns range information and functions to update the range.