Getting Started

May 2, 2026 ยท View on GitHub

Install the Package

DayPicker is available as the @daypicker/react npm package.

npm install @daypicker/react@next

:::note Legacy package name

The react-day-picker package name remains available in v10 for compatibility, but new projects should install and import from @daypicker/react.

:::

Basic Usage

To add a simple date picker to your app:

  1. Import the component and styles from @daypicker/react.
  2. Choose a selection mode using the mode prop.
  3. Use the selected and onSelect props to control the selected date.
import { useState } from "react";

import { DayPicker } from "@daypicker/react";
import "@daypicker/react/style.css";

export function MyDatePicker() {
  const [selected, setSelected] = useState<Date>();

  return (
    <DayPicker
      animate
      mode="single"
      selected={selected}
      onSelect={setSelected}
      footer={
        selected ? `Selected: ${selected.toLocaleDateString()}` : "Pick a day."
      }
    />
  );
}

Learn More

  • ๐Ÿ“˜ DayPicker Anatomy - Understand the parts that make up a DayPicker component.
  • ๐ŸŽฎ DayPicker Playground - Experiment with v10 and see the code update in real time.
  • ๐Ÿ“š API Reference - Browse the v10 props, components, labels, utilities, and calendar package APIs.

Customization

  • ๐ŸŽจ Styling - Customize the style to match DayPicker with your app's look and feel.
  • โš™๏ธ Appearance - Discover the options available to customize the calendar.
  • ๐Ÿ—“ Months Navigation - Change how users can navigate between months and years.
  • ๐Ÿงฉ Caption and Navigation Layouts - Configure how captions and navigation controls render.
  • ๐Ÿ—บ๏ธ Grid and Months - Control calendar grids and multiple-month layouts.
  • ๐Ÿ”ข Week Numbers and Footer - Show week numbers and customize footer content.

Selecting Days

  • ๐Ÿ“… Selection Modes - Enable users to select days with single, multiple, or range selections.
  • 1๏ธโƒฃ Single Mode - Configure and handle single-date selection.
  • ๐Ÿ” Multiple Mode - Allow selecting multiple dates at once.
  • โ†”๏ธ Range Mode - Manage start and end date selection ranges.
  • ๐Ÿšซ Disabling Dates - Prevent selection of specific days.

Localization

Guides