Naturally Pacifist Marsupials

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

    1.0.6 • 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
    

    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
    }

    Keywords

    none

    Install

    npm i up-material-ui-next-datepicker

    DownloadsWeekly Downloads

    2

    Version

    1.0.6

    License

    ISC

    Unpacked Size

    2.51 MB

    Total Files

    14

    Last publish

    Collaborators

    • hesquibet