Choice JS

  • Choice.js is important for improving user experience by providing accessible and customizable dropdown menus that are easy to integrate into web forms For more details
  • Installation
    npm i choices.js
    • For use of ChoiceJS we create own custom hook with the help of choices.js
    • The navigation path of this file are ../src/components/choices.js
    • For the use of ChoiceJS you want appear in your component please follow the below example code
    Script
    import ChoicesJs from "../../components/choices";
    const options = [
      { value: "Past 30 Days", label: "Past 30 Days" },
      { value: "Past 60 Days", label: "Past 60 Days" },
      { value: "Past 90 Days", label: "Past 90 Days" },
      { value: "Past 1 year", label: "Past 1 year" },
      { value: "Past 2 year", label: "Past 2 year" },
    ];
    
    const Index = () => {
    return(
        <div className="form-group mb-0 ">
                <ChoicesJs options={options} className="js-choice" select="one" />
        </div>
    )
    }