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-modular-datepicker

v0.0.12

Published

A modular, lightweight, and type-safe React datepicker and calendar component with headless hooks for single, multiple, and range selection.

Readme

react-modular-datepicker

A modular, lightweight, and type-safe React datepicker library. Whether you need a fully-featured calendar component or a headless hook to build your own UI, react-modular-datepicker has you covered.

Features

  • 🏗️ Headless & Modular: Use the useDates hook for complete control over your UI, or the Calendar component for a ready-to-use setup.
  • 🪶 Lightweight: Small footprint with a pluggable adapter system (defaults to Day.js).
  • 🛡️ Type-safe: Written in TypeScript for a great developer experience.
  • 🎨 Fully Customizable: Style everything via Tailwind CSS or custom class names.
  • 🌍 Localized: Easy internationalization support with dayjs or custom adapters.
  • ⚡ Feature-rich: Single, multiple, and range selection modes, min/max dates, disabled dates, and more.

Installation

npm install react-modular-datepicker dayjs
# or
pnpm add react-modular-datepicker dayjs
# or
yarn add react-modular-datepicker dayjs

Note: dayjs is an optional peer dependency used as the default date adapter. You can also implement a custom DateAdapter (e.g., using date-fns or Luxon).


Quick Start

Calendar Component

import { Calendar } from 'react-modular-datepicker';
import 'react-modular-datepicker/dist/index.css';

export function App() {
  return <Calendar onChange={(date) => console.log(date)} />;
}

useDates Hook (Headless)

import { useDates } from 'react-modular-datepicker';

export function CustomCalendar() {
  const { calendars, getDateProps, getBackProps, getForwardProps } = useDates({
    selectionMode: 'single',
  });

  const calendar = calendars[0];
  if (!calendar) return null;

  return (
    <div>
      <div className="flex justify-between">
        <button {...getBackProps({ calendars })}>Prev</button>
        <span>{calendar.year} - {calendar.month + 1}</span>
        <button {...getForwardProps({ calendars })}>Next</button>
      </div>
      <div className="grid grid-cols-7">
        {calendar.weeks.flat().map((dateObj, i) => (
          dateObj ? (
            <button key={i} {...getDateProps({ dateObj })}>
              {dateObj.date.getDate()}
            </button>
          ) : <div key={i} />
        ))}
      </div>
    </div>
  );
}

Documentation & Recipes

For full API reference, recipes, and interactive demos, check out the documentation package in packages/docs.

To run the documentation site locally:

pnpm run dev

Development

Installation

pnpm install

Development Server

Start watching for library changes and run the documentation app:

pnpm run dev

Testing

Run unit and end-to-end tests:

pnpm run test

Building

Build the package and documentation:

pnpm run build

License

MIT