ziweiwu / react-date-picker

A React date picker component using HIG design element

Home Page:https://www.npmjs.com/package/react-hig-datepicker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-hig-datepicker

This is a simple date picker component with HIG element and style

Demo

demo link: https://ziweiwu.github.io/fusion-hig-prototyping

Install the package

yarn add react-hig-datepicker

Usage Example

import DatePicker from 'react-hig-datepicker'
import 'react-hig-datepicker/lib/datePicker.css';

export default class Default extends Component {
  constructor(props) {
    super(props);
    this.state = {
      startDate: undefined,
    };
    this.handleChangeDate = this.handleChangeDate.bind(this);
  }

  handleChangeDate(date) {
    this.setState({ startDate: date });
  }

  render() {
    return (
      <DatePicker
        onChange={this.handleChangeDate}
        selected={this.state.startDate}
      />
    );
  }
}

More details on props

See https://github.com/ziweiwu/react-date-picker/blob/master/README.md

About

A React date picker component using HIG design element

https://www.npmjs.com/package/react-hig-datepicker

License:MIT License


Languages

Language:SCSS 52.0%Language:JavaScript 47.4%Language:Shell 0.6%