react-calendar vs react-datepicker vs react-datetime vs react-day-picker
Selecting the Right Date Picker Component for React Applications
react-calendarreact-datepickerreact-datetimereact-day-pickerSimilar Packages:

Selecting the Right Date Picker Component for React Applications

react-calendar, react-datepicker, react-datetime, and react-day-picker are popular libraries for handling date selection in React applications. They provide pre-built UI components for calendars and date inputs, handling complex logic like leap years, localization, and date formatting. While they share the same goal, they differ significantly in maintenance status, customization options, and dependency requirements. Some are full-featured input fields, while others focus on the calendar grid itself.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
react-calendar03,782271 kB382 months agoMIT
react-datepicker08,3714.5 MB716 months agoMIT
react-datetime02,005291 kB1812 years agoMIT
react-day-picker06,821987 kB7a month agoMIT

React Date Pickers: Architecture, Maintenance, and API Compared

Choosing a date picker seems simple until you need to handle time zones, localization, or custom styling. react-calendar, react-datepicker, react-datetime, and react-day-picker all solve this problem, but they take different approaches. Some give you a ready-made input box, while others give you a calendar grid to build upon. Let's compare how they handle real-world engineering challenges.

⚠️ Maintenance Status: Active vs Legacy

Before writing code, check if the library is safe to use. Some packages have stopped receiving updates, which poses risks for security and React compatibility.

react-datetime is effectively legacy.

  • It has not seen significant updates in years.
  • It relies on moment.js, which is in maintenance mode.
  • Using it in new projects is not recommended.
// react-datetime: Legacy pattern (Avoid in new projects)
import Datetime from 'react-datetime';
import moment from 'moment';

// Requires moment.js which adds significant bundle weight
<Datetime initialValue={moment()} />

react-calendar, react-datepicker, and react-day-picker are actively maintained.

  • They support modern React versions (18+).
  • They have moved away from heavy dependencies like moment.js.
  • They receive regular bug fixes and feature updates.
// react-calendar: Active maintenance
import Calendar from 'react-calendar';

<Calendar value={new Date()} />
// react-datepicker: Active maintenance
import DatePicker from 'react-datepicker';

<DatePicker selected={new Date()} />
// react-day-picker: Active maintenance
import { DayPicker } from 'react-day-picker';

<DayPicker selected={new Date()} />

📥 Basic Usage: Input Field vs Calendar Grid

The most obvious difference is what component you actually render. Some libraries provide a text input that toggles a calendar, while others provide just the calendar.

react-datepicker provides a complete input field.

  • You get a text box and a popup calendar in one component.
  • It handles focus and blur states automatically.
  • Best for standard forms.
// react-datepicker: Input + Calendar
import DatePicker from 'react-datepicker';
import 'react-datepicker/dist/react-datepicker.css';

function MyForm() {
  const [date, setDate] = useState(new Date());
  return <DatePicker selected={date} onChange={(d) => setDate(d)} />;
}

react-datetime also provides an input field.

  • Similar to react-datepicker but with older API patterns.
  • Includes time selection by default.
  • Less flexible styling.
// react-datetime: Input + Calendar + Time
import Datetime from 'react-datetime';

function MyForm() {
  return <Datetime value={new Date()} />;
}

react-calendar provides only the calendar grid.

  • No text input is included.
  • You must build the input wrapper yourself.
  • Great for embedding calendars in dashboards.
// react-calendar: Calendar Grid Only
import Calendar from 'react-calendar';

function MyDashboard() {
  const [date, setDate] = useState(new Date());
  return <Calendar onChange={setDate} value={date} />;
}

react-day-picker provides the calendar grid (mostly).

  • Version 8+ focuses on the grid logic.
  • You often pair it with a custom input or use a wrapper.
  • Extremely flexible for custom UIs.
// react-day-picker: Calendar Grid Logic
import { DayPicker } from 'react-day-picker';
import 'react-day-picker/style.css';

function MyDashboard() {
  const [date, setDate] = useState(new Date());
  return <DayPicker selected={date} onSelect={setDate} />;
}

🎨 Styling: CSS Files vs CSS Modules vs Headless

How much control do you have over the look and feel? This is often the deciding factor for design teams.

react-datepicker uses a global CSS file.

  • You import a .css file that styles everything.
  • Overriding styles requires CSS specificity hacks.
  • Can conflict with existing CSS frameworks.
// react-datepicker: Global CSS import
import 'react-datepicker/dist/react-datepicker.css';

// To override, you often need !important or specific selectors
.react-datepicker__day--selected {
  background-color: blue !important;
}

react-datetime uses Bootstrap classes by default.

  • It expects Bootstrap to be loaded in your project.
  • Hard to use if you don't use Bootstrap.
  • Styling is rigid.
// react-datetime: Bootstrap dependency
// Requires Bootstrap CSS in your project
import 'bootstrap/dist/css/bootstrap.css';
import Datetime from 'react-datetime';

// Classes like .rdt are tied to Bootstrap structure

react-calendar uses standard CSS classes.

  • Comes with a CSS file but classes are predictable.
  • Easier to override than react-datepicker.
  • No framework dependency.
// react-calendar: Predictable classes
import 'react-calendar/dist/Calendar.css';

// Classes like .react-calendar__tile are easy to target
.react-calendar__tile--active {
  background: purple;
}

react-day-picker supports CSS Modules and custom styles.

  • Version 8+ uses CSS variables for theming.
  • You can style it without overriding specific classes.
  • Best for design systems.
// react-day-picker: CSS Variables
:root {
  --rdp-cell-size: 40px;
  --rdp-accent-color: blue;
}

// No need to override specific component classes

🌍 Localization: Built-in vs External Libraries

Handling different languages and date formats is critical for global apps.

react-datepicker uses date-fns internally.

  • You pass a locale prop from date-fns.
  • Lightweight and modern.
  • Easy to switch languages dynamically.
// react-datepicker: date-fns locale
import { fr } from 'date-fns/locale';

<DatePicker locale={fr} />

react-datetime uses moment.js.

  • You set locale via moment.locale().
  • moment.js is heavy (60kb+).
  • Slows down initial load time.
// react-datetime: moment.js locale
import moment from 'moment';
moment.locale('fr');

<Datetime />;

react-calendar has built-in localization.

  • It detects browser locale by default.
  • You can pass a locale string manually.
  • No external date library required for basic usage.
// react-calendar: Built-in locale
<Calendar locale="fr-FR" />

react-day-picker uses Intl API.

  • No external date library needed for formatting.
  • Very lightweight.
  • Relies on browser support for Intl.
// react-day-picker: Intl API
<DayPicker locale="fr-CA" />

🧩 Customization: Rendering Custom Cells

Sometimes you need to highlight specific dates or add icons to days.

react-datepicker uses renderDayContents.

  • Lets you change the content inside a day cell.
  • Does not let you replace the whole cell structure easily.
  • Good for adding badges or icons.
// react-datepicker: Custom day content
<DatePicker
  renderDayContents={(day, date) => {
    if (day === 15) return '💰';
    return day;
  }}
/>

react-datetime has limited customization.

  • Hard to inject custom components into cells.
  • You mostly rely on CSS classes.
  • Not suitable for complex calendar views.
// react-datetime: CSS class injection
<Datetime
  renderView={(props) => {
    // Limited control over rendering logic
    return <div>{props.children}</div>;
  }}
/>

react-calendar uses tileContent.

  • Allows you to render extra content inside a tile.
  • You can conditionally show markers or events.
  • Clean API for extensions.
// react-calendar: Tile content
<Calendar
  tileContent={({ date, view }) => {
    if (view === 'month' && date.getDate() === 1) {
      return <span className="marker">New Month</span>;
    }
  }}
/>

react-day-picker uses components prop.

  • You can replace the entire Day component.
  • Maximum control over structure and events.
  • Ideal for complex scheduling UIs.
// react-day-picker: Custom components
<DayPicker
  components={{
    Day: ({ date, displayMonth }) => (
      <button className="custom-day">{date.getDate()}</button>
    )
  }}
/>

📊 Summary: Key Differences

Featurereact-calendarreact-datepickerreact-datetimereact-day-picker
Component TypeCalendar GridInput + PopupInput + PopupCalendar Grid
Maintenance✅ Active✅ Active❌ Legacy✅ Active
StylingCSS ClassesGlobal CSSBootstrapCSS Variables
Date LibraryNone (Native)date-fnsmoment.jsIntl API
CustomizationMediumLowLowHigh

💡 The Big Picture

react-datepicker is the safe default for forms.
It works out of the box, looks familiar to users, and handles input masking well. Use it for admin panels, booking forms, or any standard data entry.

react-day-picker is the choice for custom designs.
If your design team says "it needs to look unique," pick this. It gives you the logic without forcing a specific look. It is perfect for design systems.

react-calendar is best for dashboard widgets.
Use it when you want to show a calendar permanently on the screen, not inside a dropdown. It pairs well with custom inputs if you need them.

react-datetime should be avoided.
It relies on outdated technology (moment.js) and lacks active maintenance. Migrating to react-datepicker or react-day-picker will save you technical debt in the long run.

Final Thought: All these libraries solve the same problem, but they fit different architectural needs. Prioritize maintenance status and styling flexibility over feature count. A library that is easy to style and update is worth more than one with extra features you cannot customize.

How to Choose: react-calendar vs react-datepicker vs react-datetime vs react-day-picker

  • react-calendar:

    Choose react-calendar if you need a standalone calendar view without a built-in text input field. It is part of a well-maintained ecosystem by Wojtek Maj and works well when you want to build a custom date picker UI around a reliable calendar grid. It is ideal for dashboards or widgets where users select dates from a visible month view.

  • react-datepicker:

    Choose react-datepicker if you want a traditional input field that opens a calendar dropdown when clicked. It is widely adopted, supports TypeScript, and offers a good balance of features out of the box. It is suitable for standard forms where users expect a text input with a calendar popup.

  • react-datetime:

    Do NOT choose react-datetime for new projects. This package is largely considered legacy and is no longer actively maintained compared to modern alternatives. It relies on older patterns and may have unresolved security or compatibility issues with recent React versions. Evaluate react-datepicker or react-day-picker instead.

  • react-day-picker:

    Choose react-day-picker if you need maximum control over styling and behavior. It is highly customizable, supports modern React patterns, and does not force specific styles on you. It is best for design systems or applications requiring a unique look and feel that standard pickers cannot provide.

README for react-calendar

npm downloads CI

react-calendar

Ultimate calendar for your React app.

  • Pick days, months, years, or even decades
  • Supports range selection
  • Supports virtually any language
  • No moment.js needed

tl;dr

  • Install by executing npm install react-calendar or yarn add react-calendar.
  • Import by adding import Calendar from 'react-calendar'.
  • Use by adding <Calendar />. Use onChange prop for getting new values.

Demo

A minimal demo page can be found in sample directory.

Online demo is also available!

Before you continue

react-calendar is under constant development. This documentation is written for react-calendar 4.x branch. If you want to see documentation for other versions of react-calendar, use dropdown on top of GitHub page to switch to an appropriate tag. Here are quick links to the newest docs from each branch:

Getting started

Compatibility

Your project needs to use React 16.8 or later.

react-calendar uses modern web technologies. That's why it's so fast, lightweight and easy to style. This, however, comes at a cost of supporting only modern browsers.

My locale isn't supported! What can I do?

If your locale isn't supported, you can use Intl.js or another Intl polyfill along with react-calendar.

Installation

Add react-calendar to your project by executing npm install react-calendar or yarn add react-calendar.

Usage

Here's an example of basic usage:

import { useState } from 'react';
import Calendar from 'react-calendar';

type ValuePiece = Date | null;

type Value = ValuePiece | [ValuePiece, ValuePiece];

function MyApp() {
  const [value, onChange] = useState<Value>(new Date());

  return (
    <div>
      <Calendar onChange={onChange} value={value} />
    </div>
  );
}

Check the sample directory in this repository for a full working example. For more examples and more advanced use cases, check Recipes in react-calendar Wiki.

Custom styling

If you want to use default react-calendar styling to build upon it, you can import react-calendar's styles by using:

import 'react-calendar/dist/Calendar.css';

User guide

Calendar

Displays a complete, interactive calendar.

Props

Prop nameDescriptionDefault valueExample values
activeStartDateThe beginning of a period that shall be displayed. If you wish to use react-calendar in an uncontrolled way, use defaultActiveStartDate instead.(today)new Date(2017, 0, 1)
allowPartialRangeWhether to call onChange with only partial result given selectRange prop.falsetrue
calendarTypeType of calendar that should be used. Can be 'gregory, 'hebrew', 'islamic', 'iso8601'. Setting to "gregory" or "hebrew" will change the first day of the week to Sunday. Setting to "islamic" will change the first day of the week to Saturday. Setting to "islamic" or "hebrew" will make weekends appear on Friday to Saturday.Type of calendar most commonly used in a given locale'iso8601'
classNameClass name(s) that will be added along with "react-calendar" to the main react-calendar <div> element.n/a
  • String: "class1 class2"
  • Array of strings: ["class1", "class2 class3"]
data-testidThe test ID used for testing purposes.n/a'calendar'
defaultActiveStartDateThe beginning of a period that shall be displayed by default. If you wish to use react-calendar in a controlled way, use activeStartDate instead.(today)new Date(2017, 0, 1)
defaultValueCalendar value that shall be selected initially. Can be either one value or an array of two values. If you wish to use react-calendar in a controlled way, use value instead.n/a
  • Date: new Date()
  • An array of dates: [new Date(2017, 0, 1), new Date(2017, 7, 1)]
defaultViewDetermines which calendar view shall be opened initially. Does not disable navigation. Can be "month", "year", "decade" or "century". If you wish to use react-calendar in a controlled way, use view instead.The most detailed view allowed"year"
formatDayFunction called to override default formatting of day tile labels. Can be used to use your own formatting function.(default formatter)(locale, date) => formatDate(date, 'd')
formatLongDateFunction called to override default formatting of day tile abbr labels. Can be used to use your own formatting function.(default formatter)(locale, date) => formatDate(date, 'dd MMM YYYY')
formatMonthFunction called to override default formatting of month names. Can be used to use your own formatting function.(default formatter)(locale, date) => formatDate(date, 'MMM')
formatMonthYearFunction called to override default formatting of months and years. Can be used to use your own formatting function.(default formatter)(locale, date) => formatDate(date, 'MMMM YYYY')
formatShortWeekdayFunction called to override default formatting of weekday names (shortened). Can be used to use your own formatting function.(default formatter)(locale, date) => formatDate(date, 'dd')
formatWeekdayFunction called to override default formatting of weekday names. Can be used to use your own formatting function.(default formatter)(locale, date) => formatDate(date, 'dd')
formatYearFunction called to override default formatting of year in the top navigation section. Can be used to use your own formatting function.(default formatter)(locale, date) => formatDate(date, 'YYYY')
goToRangeStartOnSelectWhether to go to the beginning of the range when selecting the end of the range.truefalse
inputRefA prop that behaves like ref, but it's passed to main <div> rendered by <Calendar> component.n/a
  • Function:
    (ref) => { this.myCalendar = ref; }
  • Ref created using createRef:
    this.ref = createRef();

    inputRef={this.ref}
  • Ref created using useRef:
    const ref = useRef();

    inputRef={ref}
localeLocale that should be used by the calendar. Can be any IETF language tag. Note: When using SSR, setting this prop may help resolving hydration errors caused by locale mismatch between server and client.Server locale/User's browser settings"hu-HU"
maxDateMaximum date that the user can select. Periods partially overlapped by maxDate will also be selectable, although react-calendar will ensure that no later date is selected.n/aDate: new Date()
maxDetailThe most detailed view that the user shall see. View defined here also becomes the one on which clicking an item will select a date and pass it to onChange. Can be "month", "year", "decade" or "century"."month""year"
minDateMinimum date that the user can select. Periods partially overlapped by minDate will also be selectable, although react-calendar will ensure that no earlier date is selected.n/aDate: new Date()
minDetailThe least detailed view that the user shall see. Can be "month", "year", "decade" or "century"."century""decade"
navigationAriaLabelaria-label attribute of a label rendered on calendar navigation bar.n/a"Go up"
navigationAriaLivearia-live attribute of a label rendered on calendar navigation bar.undefined"polite"
navigationLabelContent of a label rendered on calendar navigation bar.(default label)({ date, label, locale, view }) => alert(`Current view: ${view}, date: ${date.toLocaleDateString(locale)}`)
next2AriaLabelaria-label attribute of the "next on higher level" button on the navigation pane.n/a"Jump forwards"
next2LabelContent of the "next on higher level" button on the navigation pane. Setting the value explicitly to null will hide the icon."»"
  • String: "»"
  • React element: <DoubleNextIcon />
nextAriaLabelaria-label attribute of the "next" button on the navigation pane.n/a"Next"
nextLabelContent of the "next" button on the navigation pane. Setting the value explicitly to null will hide the icon."›"
  • String: "›"
  • React element: <NextIcon />
onActiveStartDateChangeFunction called when the user navigates from one view to another using previous/next button. Note that this function will not be called when e.g. drilling up from January 2021 to 2021 or drilling down the other way around.
action signifies the reason for active start date change and can be one of the following values: "prev", "prev2", "next", "next2", "drillUp", "drillDown", "onChange".
n/a({ action, activeStartDate, value, view }) => alert('Changed view to: ', activeStartDate, view)
onChangeFunction called when the user clicks an item (day on month view, month on year view and so on) on the most detailed view available.n/a(value, event) => alert('New date is: ', value)
onClickDayFunction called when the user clicks a day.n/a(value, event) => alert('Clicked day: ', value)
onClickDecadeFunction called when the user clicks a decade.n/a(value, event) => alert('Clicked decade: ', value)
onClickMonthFunction called when the user clicks a month.n/a(value, event) => alert('Clicked month: ', value)
onClickWeekNumberFunction called when the user clicks a week number.n/a(weekNumber, date, event) => alert('Clicked week: ', weekNumber, 'that starts on: ', date)
onClickYearFunction called when the user clicks a year.n/a(value, event) => alert('Clicked year: ', value)
onDrillDownFunction called when the user drills down by clicking a tile.n/a({ activeStartDate, view }) => alert('Drilled down to: ', activeStartDate, view)
onDrillUpFunction called when the user drills up by clicking drill up button.n/a({ activeStartDate, view }) => alert('Drilled up to: ', activeStartDate, view)
onViewChangeFunction called when the user navigates from one view to another using drill up button or by clicking a tile.
action signifies the reason for view change and can be one of the following values: "prev", "prev2", "next", "next2", "drillUp", "drillDown", "onChange".
n/a({ action, activeStartDate, value, view }) => alert('New view is: ', view)
prev2AriaLabelaria-label attribute of the "previous on higher level" button on the navigation pane.n/a"Jump backwards"
prev2LabelContent of the "previous on higher level" button on the navigation pane. Setting the value explicitly to null will hide the icon."«"
  • String: "«"
  • React element: <DoublePreviousIcon />
prevAriaLabelaria-label attribute of the "previous" button on the navigation pane.n/a"Previous"
prevLabelContent of the "previous" button on the navigation pane. Setting the value explicitly to null will hide the icon."‹"
  • String: "‹"
  • React element: <PreviousIcon />
returnValueWhich dates shall be passed by the calendar to the onChange function and onClick{Period} functions. Can be "start", "end" or "range". The latter will cause an array with start and end values to be passed."start""range"
selectRangeWhether the user shall select two dates forming a range instead of just one. Note: This feature will make react-calendar return array with two dates regardless of returnValue setting.falsetrue
showDoubleViewWhether to show two months/years/… at a time instead of one. Defaults showFixedNumberOfWeeks prop to be true.falsetrue
showFixedNumberOfWeeksWhether to always show fixed number of weeks (6). Forces showNeighboringMonth prop to be true.falsetrue
showNavigationWhether a navigation bar with arrows and title shall be rendered.truefalse
showNeighboringCenturyWhether decades from next century shall be rendered to fill the entire last row in.falsetrue
showNeighboringDecadeWhether years from next decade shall be rendered to fill the entire last row in.falsetrue
showNeighboringMonthWhether days from previous or next month shall be rendered if the month doesn't start on the first day of the week or doesn't end on the last day of the week, respectively.truefalse
showWeekNumbersWhether week numbers shall be shown at the left of MonthView or not.falsetrue
tileClassNameClass name(s) that will be applied to a given calendar item (day on month view, month on year view and so on).n/a
  • String: "class1 class2"
  • Array of strings: ["class1", "class2 class3"]
  • Function: ({ activeStartDate, date, view }) => view === 'month' && date.getDay() === 3 ? 'wednesday' : null
tileContentAllows to render custom content within a given calendar item (day on month view, month on year view and so on).n/a
  • String: "Sample"
  • React element: <TileContent />
  • Function: ({ activeStartDate, date, view }) => view === 'month' && date.getDay() === 0 ? <p>It's Sunday!</p> : null
tileDisabledPass a function to determine if a certain day should be displayed as disabled.n/a({ activeStartDate, date, view }) => date.getDay() === 0
valueCalendar value. Can be either one value or an array of two values. If you wish to use react-calendar in an uncontrolled way, use defaultValue instead.n/a
  • Date: new Date()
  • String: 2017-01-01
  • An array of dates: [new Date(2017, 0, 1), new Date(2017, 7, 1)]
  • An array of strings: ['2017-01-01', '2017-08-01']
viewDetermines which calendar view shall be opened. Does not disable navigation. Can be "month", "year", "decade" or "century". If you wish to use react-calendar in an uncontrolled way, use defaultView instead.The most detailed view allowed"year"

MonthView, YearView, DecadeView, CenturyView

Displays a given month, year, decade and a century, respectively.

Props

Prop nameDescriptionDefault valueExample values
activeStartDateThe beginning of a period that shall be displayed.n/anew Date(2017, 0, 1)
hoverThe date over which the user is hovering. Used only when selectRange is enabled, to render a “WIP” range when the user is selecting range.n/anew Date(2017, 0, 1)
maxDateMaximum date that the user can select. Periods partially overlapped by maxDate will also be selectable, although react-calendar will ensure that no later date is selected.n/aDate: new Date()
minDateMinimum date that the user can select. Periods partially overlapped by minDate will also be selectable, although react-calendar will ensure that no earlier date is selected.n/aDate: new Date()
onClickFunction called when the user clicks an item (day on month view, month on year view and so on).n/a(value) => alert('New date is: ', value)
tileClassNameClass name(s) that will be applied to a given calendar item (day on month view, month on year view and so on).n/a
  • String: "class1 class2"
  • Array of strings: ["class1", "class2 class3"]
  • Function: ({ date, view }) => view === 'month' && date.getDay() === 3 ? 'wednesday' : null
tileContentAllows to render custom content within a given item (day on month view, month on year view and so on). Note: For tiles with custom content you might want to set fixed height of react-calendar__tile to ensure consistent layout.n/a({ date, view }) => view === 'month' && date.getDay() === 0 ? <p>It's Sunday!</p> : null
valueCalendar value. Can be either one value or an array of two values.n/a
  • Date: new Date()
  • An array of dates: [new Date(2017, 0, 1), new Date(2017, 7, 1)]
  • String: 2017-01-01
  • An array of strings: ['2017-01-01', '2017-08-01']

Useful links

License

The MIT License.

Author

Wojciech Maj Wojciech Maj

Thank you

Sponsors

Thank you to all our sponsors! Become a sponsor and get your image on our README on GitHub.

Backers

Thank you to all our backers! Become a backer and get your image on our README on GitHub.

Top Contributors

Thank you to all our contributors that helped on this project!

Top Contributors