Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-pikaday

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-pikaday

A React component wrapper around Pikaday.

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by100%
Maintainers
2
Weekly downloads
 
Created
Source

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

valueA Date object to set the currently-displayed date to.
onChange A callback called when the date is updated by the user. Passes a Date object as the first argument.
valueLink Instead of manually hooking up value/onChange to a state variable, you can instead use LinkedStateMixin to bind the two.

FAQs

Package last updated on 19 Aug 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc