Saturday, October 25, 2025
HomeLanguagesJavascriptReact Suite DateRangePicker Component

React Suite DateRangePicker Component

React Suite is a popular front-end library with a set of React components that are designed for the middle platform and back-end products. DateRangePicker component allows the user to quickly select a date range. We can use the following approach in ReactJS to use the React Suite DateRangePicker Component.

DateRangePicker Props:

  • appearance: It is used for the component appearance.
  • block: It is used to block an entire row.
  • cleanable: It is used to indicate whether the option can be emptied or not.
  • container: It is used to set the rendering container.
  • defaultCalendarValue: It is used to denote the default calendar panel date.
  • defaultOpen: It is used to denote the default value of the open property.
  • defaultValue: It is used to denote the default value.
  • disabled: It is used to indicate whether the component is disabled or not.
  • disabledDate: It is used to disable the date.
  • hoverRange: It is used to select the date range when you click on the date.
  • isoWeek: It is a boolean value denoting the ISO 8601 standard set or not.
  • limitEndYear: It is used to set the lower limit of the available year relative to the currently selected date.
  • onChange: It is a callback function that is triggered when the value changes.
  • onClean: It is a callback function that is triggered when value clean.
  • onClose: It is a callback function that is triggered on a close event.
  • onEnter: It is a callback function that is triggered before the overlay transitions in.
  • onEntered: It is a callback function that is triggered after the overlay finishes transitioning in.
  • onEntering: It is a callback function that is triggered as the overlay begins to transition in.
  • onExit: It is a callback function that is triggered right before the overlay transitions out.
  • onExited: It is a callback function that is triggered after the overlay finishes transitioning out.
  • onExiting: It is a callback function that is triggered as the overlay begins to transition out.
  • onOk: It is a callback function that is triggered on click ok the Ok button.
  • onOpen: It is a callback function that is triggered on open of the component.
  • onSelect: It is a callback function that is triggered on the selection of date or time.
  • oneTap: It is used to indicate whether to enable One-click to complete the selection date or not.
  • open: It is used to indicate whether open the component or not.
  • placeholder: It is used to denote the placeholder.
  • placement: It is used for the placement of component.
  • preventOverflow: It is used to prevent floating element overflow.
  • ranges: It is used for the shortcut config.
  • renderValue: It is used for the custom render selected date range.
  • showOneCalendar: It is used to indicate whether to show only one calendar or not.
  • showWeekNumbers: It is used to indicate whether to show week numbers or not.
  • size: It is used to denote the picker size.
  • toggleComponentClass: It can be used for the custom element for this component.
  • value: It is used to denote the value (Controlled).

Creating React Application And Installing Module:

  • Step 1: Create a React application using the following command:

    npx create-react-app foldername
  •  

  • Step 2: After creating your project folder i.e. foldername, move to it using the following command:

    cd foldername
  • Step 3: After creating the ReactJS application, Install the required module using the following command:

    npm install rsuite

Project Structure: It will look like the following.

Project Structure

Example: Now write down the following code in the App.js file. Here, App is our default component where we have written our code.

App.js




import React from 'react'
import 'rsuite/dist/styles/rsuite-default.css';
import { DateRangePicker } from 'rsuite';
  
export default function App() {
  
  return (
    <div style={{
      display: 'block', width: 600, paddingLeft: 30
    }}>
      <h4>React Suite DateRangePicker Component</h4>
      <DateRangePicker
        style={{ width: 300 }}
        placeholder="Select Date Range"
      />
    </div>
  );
}


Step to Run Application: Run the application using the following command from the root directory of the project:

npm start

Output: Now open your browser and go to http://localhost:3000/, you will see the following output:

Reference: https://rsuitejs.com/components/date-range-picker/

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS