react-day-picker 0,1,1 codeclimate coveralls eslint travis-ci Bower npm webpack

Flexible date picker for React

title

screen shot

react-day-picker is a flexible date picker component for React.

Check out the examples to see its features.

npm version Bower build status coveralls Code Climate npm downloads

Quick start

Installing via npm

npm install react-day-picker --save

Using unpkg CDN

<script src="https://unpkg.com/react-day-picker"></script>

Installing via Bower

bower install react-day-picker --save

The bower package exposes a global DayPicker variable.

Example

import React from 'react';
import DayPicker, { DateUtils } from "react-day-picker";

function sunday(day) {
  return day.getDay() === 0;
}

class MyComponent extends React.Component {
  state = {
    selectedDay: new Date(),
  }
  handleDayClick(e, day, { selected, disabled }) {
    if (disabled) {
      return;
    }
    if (selected) {
      this.setState({ selectedDay: null })
    } else {
      this.setState({ selectedDay: day });
    }
  },
  render() {
    return (
      <DayPicker
        initialMonth={ new Date(2016, 1) }
        disabledDays={ sunday }
        selectedDays={ day => DateUtils.isSameDay(this.state.selectedDay, day) }
        onDayClick={ this.handleDayClick.bind(this) }
    />);
  }
}

See Basic usage for a deeper explanation of the example above.

Docs and examples

Get support

Contribute

  • File bugs and feature requests in the issues page
  • Check out the source code on Github
  • Pull requests are welcome! If you are planning a pull request with lot of changes, please add an issue to discuss your idea first
    • See how to start the project locally here

Related Repositories

awesome-react

awesome-react

A collection of awesome things regarding React ecosystem. ...

awesome-react-components

awesome-react-components

Catalog of React Components & Libraries ...

react-datepicker

react-datepicker

A simple and reusable datepicker component for React ...

react-datetime

react-datetime

A lightweight but complete datetime picker react component. ...


Top Contributors

gpbl srph limscoder makenosound boatkorachal JKillian tomasberg adambbecker adidahiya kblcuk iancmyers pguimera McFreely stanislav-ermakov-roi hugoduraes zaygraveyard akirk frandsaw fczuardi fcsonline GertjanReynaert webbushka megheaiulian johannesd majapw NXTaar nonmanifold gitter-badger hideto0710

Dependencies

package version
object-assign ^4.1.1
prop-types ^15.5.10
dev @types/react 15.0.30
autoprefixer ^7.1.2
babel-cli ^6.24.1
babel-core ^6.25.0
babel-eslint ^7.2.3
babel-loader ^7.1.1
babel-plugin-transform-react-remove-prop-types ^0.4.6
babel-preset-es2015 ^6.24.1
babel-preset-react ^6.24.1
babel-preset-stage-1 ^6.24.1
cheerio ^1.0.0-rc.2
codecov ^2.2.0
dtslint ^0.1.2
enzyme ^2.9.1
eslint ^3.19.0
eslint-config-airbnb ^15.0.2
eslint-config-prettier ^2.3.0
eslint-plugin-import ^2.7.0
eslint-plugin-prettier ^2.1.2
eslint-plugin-react ^7.1.0
eslint-plugin-jsx-a11y ^5.0.3
gh-pages ^1.0.0
husky ^0.14.3
jest ^20.0.4
jest-enzyme ^3.6.1
jest-junit-reporter ^1.1.0
jsdom ^11.1.0
moment ^2.18.1
null-loader ^0.1.1
postcss-cli ^4.1.0
prettier ^1.5.3
react ^15.6.1
react-dom ^15.6.1
react-hot-loader ^3.0.0-beta.6
react-test-renderer ^15.6.1
rimraf ^2.6.1
typescript ^2.4.2
webpack ^3.3.0
peer react ~0.13.x || ~0.14.x || ^15.0.0

Releases

-   v2.5.0 zip tar
-   v2.4.1 zip tar
-   v2.4.0 zip tar
-   v2.3.3 zip tar
-   v2.3.2 zip tar
-   v2.3.1 zip tar
-   v2.3.0 zip tar
-   v2.2.0 zip tar
-   v2.1.1 zip tar
-   v2.1.0 zip tar
-   v2.0.3 zip tar
-   v2.0.2 zip tar
-   v2.0.1 zip tar
-   v2.0.0 zip tar
-   v2.0.0-beta.1 zip tar
-   v2.0.0-beta zip tar
-   v1.3.2 zip tar
-   v1.3.1 zip tar
-   v1.3.0 zip tar
-   v1.2.0 zip tar
-   v1.1.6 zip tar
-   v1.1.5 zip tar
-   v1.1.3 zip tar
-   v1.1.2 zip tar
-   v1.1.1 zip tar
-   v1.1.0 zip tar
-   v1.0.10 zip tar
-   v1.0.9 zip tar
-   v1.0.7 zip tar
-   v1.0.6 zip tar