How to add Input Slider in React JS ? Last Updated : 11 Dec, 2023 Comments Improve Suggest changes Like Article Like Report We will learn how to add an input slider in React JS. React is a free and open-source front-end JavaScript library for building user interfaces or UI components. It was introduced by Facebook and a community of individual developers and companies. Prerequisites:Node JS or NPMReact JSReact useStateApproach:To add our slider input we are going to use the react-input-slider package. The react-input-slider package helps us to integrate the slider input into our app. So first, we will install the react-input-slider package and then add a slider input on our homepage. Steps to Create React Application And Installing Module:Step 1: Create a React application using the following command npx create-react-app gfgStep 2: After creating your project folder i.e. example, move to it using the following command cd gfgStep 3: Install the required package npm i react-input-sliderProject Structure: The updated dependencies in package.json file will look like: "dependencies": { "react": "^18.2.0", "react-dom": "^18.2.0", "react-input-slider": "^6.0.1", "react-scripts": "5.0.1", "web-vitals": "^2.1.4", }Example: Adding the slider input after installing the package we can easily add a slider input on any page in our app. JavaScript import React, { useState } from 'react'; import Slider from 'react-input-slider'; export default function GfgInput() { const [state, setState] = useState({ x: 15, y: 15 }); return ( <div> <h2> GeeksforGeeks ReactJs - Slider Input </h2> <div> ({state.x}, {state.y}) <Slider axis="xy" x={state.x} y={state.y} onChange={setState} /> <Slider axis="x" x={state.x} onChange={ ({ x }) => setState(state => ({ ...state, x }))}/> <Slider axis="y" y={state.y} onChange= { ({ y }) => setState(state => ({ ...state, y })) } /> </div> </div> ); } Steps to Run the Application: Run the below command in the terminal to run the app. npm startOutput: We are importing the Slider component and useState hook from react. Then we are using the useState hook to store the value of the input. After that, we are adding our slider input using the installed package. Comment More infoAdvertise with us Next Article How to add Input Slider in React JS ? I imranalam21510 Follow Improve Article Tags : JavaScript Web Technologies ReactJS React-Questions Similar Reads How to add Slider in Next.js ? Adding a slider in Next.js involves integrating a slider component, like react-range, managing its state using React hooks and applying styles for customization, enhancing user interaction and input precision in your application.ApproachTo add our Slider we are going to use the react-range package. 2 min read How to add code input in React JS? In this article, we are going to learn how we can add Code Input in React JS. React is a front-end JavaScript library for constructing user interfaces or UI components. It is maintained by Facebook and a community of individual developers and companies. Approach to add code input: To incorporate our 2 min read How to add AutoSize Input in React.js ? We are going to learn how we can add AutoSize input in ReactJs. React is a free and open-source front-end JavaScript library for building user interfaces or UI components. Prerequisites:Nodejs and NPMReact JSApproach: Â To add our autosize input we are going to use the react-input-autosize package. T 2 min read How to create Image Slider in ReactJS ? Image Slider is a dynamic web element that displays a collection of images and has a slider to switch between the Images. It is the most common feature to show image collection in web applications or mobile apps.Websites like Amazon.com, Flipkart.com, and many e-commerce sites use image sliders to s 4 min read How to Create Smaller `Input` in React-Bootstrap ? ReactJS is one of the most favorite libraries for building attractive applications. Combining Bootstrap with ReactJS is a powerful tool for making the application more interactive. A Smaller Input in React-Bootstrap refers to reducing the size of an input field component, typically achieved by apply 4 min read React MUI Slider Input Material-UI is a user interface framework that provides pre-defined and customizable React components for faster and easy web development. The Material-UI components are based on top of Material Design by Google. In this article letâs discuss the Slider API in the Material-UI library. The Slider API 4 min read What is intro slider in React Native ? We will walk through the process of creating a beautiful image slider in a React Native application using the react-native-app-intro-slider package. The image slider will serve as an onboarding feature, introducing users to key features of your app.Prerequisites:React NativeNode and NPMApproach:We'l 3 min read How to create Price Range Selector in ReactJS? Price Range Selector means the user is able to select the range between the given values. Material UI for React has this component available for us and it is very easy to integrate. Price Ranges Selectors is a very popular feature for filter the results on the basis of the range selected by the user 2 min read How to use Slide Component in ReactJS ? Slide Component adds a Slide animation to a child element or component. Material UI for React has this component available for us, and it is very easy to integrate. We can use the Slide Component in ReactJS using the following approach.Prerequisites:NodeJS or NPMReactJSMaterial UISteps to Create the 3 min read ReactJS UI Ant Design Slider Component Ant Design Library has this component pre-built, and it is very easy to integrate as well. Slider Component to used when the users want to make selections from a range of values. We can use the following approach in ReactJS to use the Ant Design Slider Component. Slider Methods: blur(): This method 3 min read Like