Skip to content

Components, that implements material design date and time pickers for material-ui v1

License

Notifications You must be signed in to change notification settings

Ponjimon/material-ui-pickers

 
 

Repository files navigation

Material-UI pickers

npm package npm download Build Status

Components, that implements material design date and time pickers for material-ui v1

Installation

Available as npm package.

npm install material-ui-pickers -S

Now choose the library that pickers will use to work with date. We are providing interfaces for moment and date-fns. If you are not using moment in the project (or dont have it in the bundle already) we suggest using date-fns, because it much more lightweight and will be correctly tree-shaked from the bundle.

npm install date-fns@next -s
// or
npm install moment -S

Then teach pickers which library to use with MuiPickerUtilsProvider.This component takes an utils property, and makes it available down the React tree thanks to React context. It should preferably be used at the root of your component tree.

import MomentUtils from 'material-ui-pickers/utils/moment-utils';
import DateFnsUtils from 'material-ui-pickers/utils/date-fns-utils';
import MuiPickersUtilsProvider from 'material-ui-pickers/utils/MuiPickersUtilsProvider';

function App() {
  return (
    <MuiPickersUtilsProvider utils={DateFnsUtils}>
      <Root />
    </MuiPickersUtilsProvider>
  );
}

render(<App />, document.querySelector('#app'));

And the last step of installation would be an icon font. By default we relying on material-icons font, but its possible to override any icons with a help of corresponding props.

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

Documentation

Check out the documentation website

Recently updated?

Changelog available here

Contributing

For information about how to contribute, see the CONTRIBUTING file.

LICENSE

The project is licensed under the terms of MIT license

About

Components, that implements material design date and time pickers for material-ui v1

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 92.5%
  • TypeScript 7.5%