0.5.1 • Published 9 years ago

react-pikaday v0.5.1

Weekly downloads
50
License
MIT
Repository
github
Last release
9 years ago

react-pikaday

Build Status npm

A component wrapper around Pikaday.

View Example

Importing

Normal

To import Pikaday without any CSS:

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 with a configured style-loader for CSS, you can actually require this component along with the Pikaday CSS in one go:

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

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

0.5.1

9 years ago

0.5.0

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.2

11 years ago

0.3.1

11 years ago

0.3.0

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago