Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react algolia range slider

import React from "react";
import { connectRange } from "react-instantsearch-dom";
import Slider from "rc-slider";
import "rc-slider/assets/index.css";

const RangeSlider = ({ min, max, currentRefinement, refine }) => {
  const onChange = (values) => {
    refine({ min: values[0], max: values[1] });
  };

  return (
    <div>
      <p className="text-gray-200 pb-4">
        Price from ({currentRefinement.min}) to ({currentRefinement.max})ETH
      </p>
      <Slider
        range
        min={min}
        max={max}
        step={0.01}
        value={[currentRefinement.min, currentRefinement.max]}
        allowCross={false}
        railStyle={{ background: "#e6e6e6", height: "5px" }}
        trackStyle={{ background: "#1BAFBF", height: "5px" }}
        onChange={onChange}
      />
    </div>
  );
};

export default connectRange(RangeSlider);
Comment

PREVIOUS NEXT
Code Example
Javascript :: extended class call method from super in javascript 
Javascript :: ajax get request parameters 
Javascript :: find duplicate values in array javascript 
Javascript :: es6 in nodejs 
Javascript :: anguler test submit form 
Javascript :: trim text after a certain word in js 
Javascript :: videojs 100%width 
Javascript :: npm hook form 
Javascript :: js filter array of objects by another object 
Javascript :: react native tab navigation header 
Javascript :: angular retry interceptor 
Javascript :: vue nuxt vuex store watch 
Javascript :: jquery append after number of chars in string 
Javascript :: jest spyon 
Javascript :: switch react router 
Javascript :: nested dto nestjs 
Javascript :: Convert array to string while preserving brackets 
Javascript :: js check if a string is a number 
Javascript :: Using Then To Create A Promise In JavaScript 
Javascript :: var js 
Javascript :: Split string into words, without punctuation 
Javascript :: javascript iterate over map values 
Javascript :: submit form react js 
Javascript :: assign random colors react chartjs 
Javascript :: download datepicker js 
Javascript :: load new site with javascript 
Javascript :: javascript ascii character a to z 
Javascript :: elapsed time function() {math javascript 
Javascript :: Icons library in react 
Javascript :: detect form input changes javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =