JSPM

  • Created
  • Published
  • Downloads 311276
  • Score
    100M100P100Q50597F
  • License MIT

React components, that implements material design pickers for material-ui v1

Package Exports

  • @material-ui/pickers
  • @material-ui/pickers/DatePicker
  • @material-ui/pickers/DateTimePicker
  • @material-ui/pickers/MuiPickersUtilsProvider
  • @material-ui/pickers/TimePicker
  • @material-ui/pickers/_helpers/date-utils
  • @material-ui/pickers/_helpers/time-utils
  • @material-ui/pickers/_helpers/utils
  • @material-ui/pickers/_shared/PickerToolbar
  • @material-ui/pickers/_shared/ToolbarButton
  • @material-ui/pickers/_shared/ToolbarText
  • @material-ui/pickers/constants/ClockType
  • @material-ui/pickers/constants/dimensions
  • @material-ui/pickers/constants/prop-types
  • @material-ui/pickers/typings/overrides
  • @material-ui/pickers/wrappers/Wrapper

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@material-ui/pickers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Material-UI logo

Material-UI pickers

Accessible, customizable, delightful date & time pickers for @material-ui/core

npm package npm download codecov Bundle Size CircleCI Cypress.io tests code style: prettier

Installation

Stable channel (v2). Docs site.

// via npm
npm i @material-ui/pickers

// via yarn
yarn add @material-ui/pickers

Next channel (v3-alpha). Docs site. Migration guide

// via npm
npm i @material-ui/pickers@next

// via yarn
yarn add @material-ui/pickers@next

Now choose the library that pickers will use to work with date. We are providing interfaces for moment, luxon, dayjs and date-fns v2. If you are not using moment in the project (or dont have it in the bundle already) we suggest using date-fns or luxon, because they are much lighter and will be correctly tree-shaked from the bundle. Note, that we are fully relying on date-io for supporting different libraries.

npm i date-fns@next @date-io/date-fns
// or
npm i moment @date-io/moment
// or
npm i luxon @date-io/luxon
// or
npm i dayjs @date-io/dayjs

Then teach pickers which library to use with MuiPickerUtilsProvider. This component takes a 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 '@date-io/moment';
import DateFnsUtils from '@date-io/date-fns';
import LuxonUtils from '@date-io/luxon';
import { MuiPickersUtilsProvider } from '@material-ui/pickers';

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

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

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