You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-daypicker

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-daypicker

A simple datepicker inspired by Pikaday.

1.0.2
Source
npmnpm
Version published
Weekly downloads
113
17.71%
Maintainers
1
Weekly downloads
 
Created
Source

react-daypicker

License Downloads

npm badge

A simple datepicker inspired by Pikaday.

DayPicker screenshot

Installation

yarn

yarn add react-daypicker

npm

npm install --save react-daypicker

Usage

import 'react-daypicker/lib/DayPicker.css';
import DayPicker from 'react-daypicker';

The only required property is onDayClick which is called when a day is clicked.

<DayPicker onDayClick={(day) => this.setState({ day })} />

An optional property active can be added in order to mark a day as active:

<DayPicker
  active={moment().add(1, 'day')}
  onDayClick={(day) => this.setState({ day })}
/>

Note that active is expected to be an instance of moment from Moment.js.

Options on styling

You can import the Sass stylesheet instead:

import 'react-daypicker/src/DayPicker.scss';

The root element is .react-daypicker-root.

Dependencies

No direct dependencies. Peer dependencies:

  • React
  • Moment.js
  • classnames

Developing

See package.json for details but simply run:

npm run build

Keywords

date

FAQs

Package last updated on 27 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts