Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 9, 2024 via pnpm

react-datepicker 4.18.0

A simple and reusable datepicker component for React
Package summary
Share
0
issues
1
license
18
MIT
Package created
10 Sep 2014
Version published
15 Sep 2023
Maintainers
2
Total deps
18
Direct deps
8
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
18 Packages, Including:
@babel/runtime@7.24.4
@popperjs/core@2.11.8
classnames@2.5.1
date-fns@2.30.0
js-tokens@4.0.0
loose-envify@1.4.0
object-assign@4.1.1
prop-types@15.8.1
react-datepicker@4.18.0
react-dom@18.2.0
react-fast-compare@3.2.2
react-is@16.13.1
react-onclickoutside@6.13.0
react-popper@2.3.0
react@18.2.0
regenerator-runtime@0.14.1
scheduler@0.23.0
warning@4.0.3
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

8
All Dependencies CSV
β“˜ This is a list of react-datepicker 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@popperjs/core2.11.8378.93 kBMIT
prod peer
classnames2.5.18.46 kBMIT
prod
date-fns2.30.0682.42 kBMIT
prod
prop-types15.8.122.12 kBMIT
prod
react-dom18.2.01.04 MBMIT
prod peer
react-onclickoutside6.13.010.96 kBMIT
prod
react-popper2.3.017.81 kBMIT
prod
react18.2.079.25 kBMIT
prod peer

Visualizations

Frequently Asked Questions

What does react-datepicker do?

React-datepicker is a simple, reusable date picker component explicitly crafted for React. It allows developers to integrate a flexible and customizable date picker into their applications. This tool offers developers easy installation via npm or yarn and is designed to work in harmony with React and PropTypes for a fully integrated solution.

How do you use react-datepicker?

To use react-datepicker in your project, you first need to install the package using npm or yarn with the following commands: For npm, use npm install react-datepicker --save For yarn, use yarn add react-datepicker After the installation, you also need to install React and PropTypes separately, as they are not included in this package.

To use the react-datepicker in your React view, you need to import it and the associated CSS file. Here's a basic usage example:

import React, { useState } from "react";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";

const Example = () => {
  const [startDate, setStartDate] = useState(new Date());
  return (
    <DatePicker selected={startDate} onChange={(date) => setStartDate(date)} />
  );
};

In the example above, the DatePicker is utilizing useState to handle the selected date. When a date is selected, it triggers the onChange event handler to update the startDate.

Also, you can include a time picker by adding showTimeSelect prop as follows:

<DatePicker
  selected={date}
  onChange={handleDateChange}
  showTimeSelect
  dateFormat="Pp"
/>

Where are the react-datepicker docs?

The react-datepicker documentation can be found on the main repository page on GitHub. The documents provide a comprehensive list of props that can be passed to the component. Moreover, additional usage examples can be found on the main website of the react-datepicker.