Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mui/x-date-pickers

Package Overview
Dependencies
Maintainers
12
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mui/x-date-pickers

The community edition of the Date and Time Picker components (MUI X).

  • 7.7.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.1M
decreased by-5.25%
Maintainers
12
Weekly downloads
 
Created

What is @mui/x-date-pickers?

The @mui/x-date-pickers package provides date and time selection components that integrate with Material-UI. It allows developers to implement date pickers, time pickers, date-time pickers, and calendar views with ease, offering a consistent design language and user experience aligned with Material Design guidelines.

What are @mui/x-date-pickers's main functionalities?

DatePicker

The DatePicker component allows users to select a date from a calendar dialog.

import * as React from 'react';
import TextField from '@mui/material/TextField';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';

function BasicDatePicker() {
  const [value, setValue] = React.useState(null);

  return (
    <DatePicker
      label="Basic example"
      value={value}
      onChange={(newValue) => {
        setValue(newValue);
      }}
      renderInput={(params) => <TextField {...params} />}
    />
  );
}

TimePicker

The TimePicker component provides a way for users to select a time.

import * as React from 'react';
import TextField from '@mui/material/TextField';
import { TimePicker } from '@mui/x-date-pickers/TimePicker';

function BasicTimePicker() {
  const [value, setValue] = React.useState(null);

  return (
    <TimePicker
      label="Basic example"
      value={value}
      onChange={(newValue) => {
        setValue(newValue);
      }}
      renderInput={(params) => <TextField {...params} />}
    />
  );
}

DateTimePicker

The DateTimePicker combines date and time selection in one control.

import * as React from 'react';
import TextField from '@mui/material/TextField';
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';

function BasicDateTimePicker() {
  const [value, setValue] = React.useState(null);

  return (
    <DateTimePicker
      label="Basic example"
      value={value}
      onChange={(newValue) => {
        setValue(newValue);
      }}
      renderInput={(params) => <TextField {...params} />}
    />
  );
}

Calendar

The Calendar component displays a full calendar view for date selection without a text field.

import * as React from 'react';
import { Calendar } from '@mui/x-date-pickers/Calendar';

function BasicCalendar() {
  const [date, setDate] = React.useState(new Date());

  return (
    <Calendar
      date={date}
      onChange={(newDate) => setDate(newDate)}
    />
  );
}

Other packages similar to @mui/x-date-pickers

Keywords

FAQs

Package last updated on 13 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc