npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-mdp

v1.0.7

Published

A modern datepicker library for React.

Readme

React Modern Date Picker

Description

A modern date picker component for React applications.

Installation

To install the package, run:

npm install react-mdp

Peer Dependencies

This package has the following peer dependencies:

react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0

Make sure these are installed in your project.

image

image

Usage

Here is a simple example of how to use the date picker in your React component:

import React from 'react';
import DatePicker from 'react-mdp';

const App = () => {
    return (
        <div>
            <h1>Select a Date</h1>
            <DatePicker />
        </div>
    );
};

export default App;

You can also pass the date or range to control

 const [singleDate, setSingleDate] = useState<Date | null>(null);
  const [dateRange, setDateRange] = useState<{ start: Date | null; end: Date | null }>({
    start: null,
    end: null
  });
  const [selectedPost, setSelectedPost] = useState<Post | null>(null);

  const handleSingleDateChange = (date: Date | null) => {
    setSingleDate(date);
    console.log('Selected date:', date);
  };

  const handleRangeChange = (range: { start: Date | null; end: Date | null }) => {
    setDateRange(range);
    console.log('Selected range:', range);
  };

   <h3>Single Date Picker</h3>
          <DatePicker
            selectedDate={singleDate || undefined}
            onDateChange={handleSingleDateChange}
            dateFormat="MM/dd/yyyy"
            placeholder="Select date..."
          />
        </div>

        <div>
          <h3>Range Date Picker</h3>
          <DatePicker
            isRange={true}
            onRangeChange={handleRangeChange}
            dateFormat="MM/dd/yyyy"
            placeholder="Select date range..."
          />
        </div>

DatePicker Component Properties

The DatePicker component accepts the following properties:

  • selectedDate (Date | undefined): The date that is currently selected. If not provided, it defaults to the current date.
  • onDateChange ((date: Date | null) => void): Callback function that is called when the date is changed. It receives the selected date as an argument.
  • isRange (boolean): If true, the date picker allows selection of a date range. Defaults to false.
  • onRangeChange ((range: { start: Date | null; end: Date | null }) => void): Callback function that is called when the date range is changed. It receives the start and end dates as an argument.
  • dateFormat (string): The format in which the date is displayed. Defaults to 'MM/dd/yyyy'.
  • placeholder (string): Placeholder text for the input field. Defaults to 'Select a date'.
  • selectionColor (string): The color used to highlight the selected date. Defaults to '#007bff'.
  • hoverColor (string): The color used when hovering over a date. Defaults to '#0056b3'.
  • className (string): Additional CSS classes to apply to the date picker component.
  • allowPastDate (boolean): If true, the date picker allows selection of past dates. Defaults to false.

Contributing

If you would like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes.
  4. Submit a pull request.

License

This project is licensed under the MIT License.