material ui date picker code example

Example 1: material ui datepicke

import React, { Fragment, useState } from "react";
import { TextField } from "@material-ui/core";
import { MobileDatePicker, DesktopDatePicker, DatePicker } from "@material-ui/pickers";

function DatePickersVariants(props) {
  const [selectedDate, handleDateChange] = useState(new Date());

  return (
    
       handleDateChange(date)}
        renderInput={props => }
      />

       handleDateChange(date)}
        renderInput={props => }
      />

       handleDateChange(date)}
        renderInput={props => }
      />
    
  );
}

export default DatePickersVariants;

Example 2: material datepicker


  Choose a date
  
  

Example 3: how to overright date picker styles material ui

import { MuiPickersComponentsToClassName } from '@material-ui/pickers/src/typings/overrides';

declare module '@material-ui/core/styles/overrides' {
  export interface ComponentNameToClassKey extends MuiPickersComponentsToClassName {}
}

Example 4: date picker material ui

hello there

Tags:

Misc Example