# react-pikaday

> A React component wrapper around Pikaday.

Latest version **0.5.1** (published 2016-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-pikaday
pnpm add react-pikaday
yarn add react-pikaday
bun add react-pikaday
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2016-08-19 |
| First published | 2014-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 108 |
| Author | Thomas Boyt |
| Maintainers | joefiorini, tboyt |

## Links

- npm: https://www.npmjs.com/package/react-pikaday
- Repository: https://github.com/thomasboyt/react-pikaday
- Homepage: https://github.com/thomasboyt/react-pikaday#readme
- Issues: https://github.com/thomasboyt/react-pikaday/issues
- npm.io page: https://npm.io/package/react-pikaday

## Dependencies (1)

- [pikaday](https://npm.io/package/pikaday.md) ^1.2.0

## Recent versions

- 0.5.1 (latest) — 2016-08-19
- 0.5.0 — 2016-08-05
- 0.4.1 — 2016-04-08
- 0.4.0 — 2016-03-01
- 0.3.2 — 2015-07-14
- 0.3.1 — 2015-07-14
- 0.3.0 — 2015-07-14
- 0.2.0 — 2015-03-12
- 0.1.0 — 2014-09-25

## README

# react-pikaday

[![Build Status](https://travis-ci.org/thomasboyt/react-pikaday.svg?branch=master)](https://travis-ci.org/thomasboyt/react-pikaday) [![npm](https://img.shields.io/npm/v/react-pikaday.svg)](https://www.npmjs.com/package/react-pikaday)

A component wrapper around [Pikaday](https://github.com/dbushell/Pikaday).

**[View Example](http://thomasboyt.github.io/react-pikaday/)**

## Importing

### Normal

To import Pikaday without any CSS:

```javascript
import Pikaday from 'react-pikaday';
```

You'll then need to make sure you include the CSS from `pikaday/css/pikaday.css`.

### Bundled

If you're using [webpack](http://webpack.github.io/) with a configured
[style-loader](https://github.com/webpack/style-loader) for CSS, you can actually require this
component along with the Pikaday CSS in one go:

```javascript
import Pikaday from 'react-pikaday/bundled';
```

See the example app in this repo and the `webpack.config.js` for an example of how this can be configured.

## Usage

```javascript
import React from 'react';
import Pikaday from 'react-pikaday';

var MyComponent = React.createClass({
  getInitialState: function() {
    return {
      date: null
    };
  },

  handleChange: function(date) {
    this.setState({
      date: date
    });
  },

  render: function() {
    var date = this.state.date;

    return (
      <div>
        <p>
          The date is {date.toDateString()}
        </p>
        <Pikaday value={date} onChange={this.handleChange} />
      </div>
    );
  }
});
```

## Properties

<table>
  <tr>
    <td><code>value</code></td>
    <td>A Date object to set the currently-displayed date to.</td>
  </tr>
  <tr>
    <td><code>onChange</code></td>
    <td>
      A callback called when the date is updated by the user. Passes a Date object as the first
      argument.
    </td>
  </tr>
  <tr>
    <td><code>valueLink</code></td>
    <td>
      Instead of manually hooking up value/onChange to a state variable, you can instead use
      <a href="http://facebook.github.io/react/docs/two-way-binding-helpers.html">LinkedStateMixin</a>
      to bind the two.
    </td>
  </tr>
</table>

---
_Source: https://npm.io/package/react-pikaday · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
