material-ui-next-datepicker
TypeScript icon, indicating that this package has built-in type declarations

1.0.15 • Public • Published

Material UI Next Datepicker

Description

This repository act as a sample of creating a datepicker in Material UI Next or it can be imported as a datepicker component.

Prerequisite

npm install material-ui-next-datepicker --save

Screenshot

Image of Material UI Clockpicker

Options

name: string
value: Date
onChange: (value:Date) => void
label?: string
error?: string
min?: Date
max?: Date
fullWidth?: boolean
dialog?: boolean

Basic setup

  1. Make sure you installed Material UI Next.
  2. Install this package via npm.
  3. Import this package and use like the following:
import DateFormatInput from 'material-ui-next-datepicker'

class YourComponent extends React.Component<{}, YourComponentState> {
  onChange = (date:Date) => {
    console.log(date)
    this.setState({date})
  } 
  render() {
    const {date} = this.state
    return (
      <div>
        <DateFormatInput name='date-input' value={date} onChange={this.onChange}/>
      </div>
    )
  } 
}
interface YourComponentState {
  date: Date
}

Readme

Keywords

none

Package Sidebar

Install

npm i material-ui-next-datepicker

Weekly Downloads

9

Version

1.0.15

License

ISC

Unpacked Size

70.7 kB

Total Files

17

Last publish

Collaborators

  • chingyawhao