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

datepckr

v1.0.67

Published

A lightweight, customizable, and accessible date picker components library for React. Supports single date selection, multi date selection, date ranges, localization, keyboard navigation, and seamless integration with any form library.

Readme

Datepckr 📅

A lightweight, customizable, and accessible date picker component library for React. Supports single date selection, date ranges, localization, and seamless integration with any UI framework.

Installation

npm install datepckr
# или
yarn add datepckr
# или
pnpm add datepckr

Quick start

import { DateRangePicker } from 'datepckr'

function MyComponent() {
  const [dates, setDates] = useState([new Date(), new Date()])

  return <DateRangePicker dates={dates} onChange={(newDates) => setDates(newDates)} />
}

Core components

DateRangePicker

The main component for selecting date ranges:

import { DateRangePicker } from 'datepckr'

return (
  <DateRangePicker
    dates={[startDate, endDate]}
    onChange={(newDates) => {
      // Handle date change
      console.log('Selected dates:', newDates)
    }}
    locale="en-US" // Optional: localization
    minDate={new Date(2020, 0, 1)} // Optional: minimum selectable date
    maxDate={new Date(2030, 11, 31)} // Optional: maximum selectable date
  />
)

DatePicker

import { DatePicker } from 'datepckr'

return <DatePicker date={selectedDate} onChange={(newDate) => setSelectedDate(newDate)} />

Integration Examples

With Material-UI (MUI)

Perfect integration with MUI's Menu component:

import { useState } from 'react'
import { IconButton, Menu } from '@mui/material'
import { CalendarMonthOutlined } from '@mui/icons-material'
import { DateRangePicker } from 'datepckr'

function DatePickerWithMenu() {
  const [anchorEl, setAnchorEl] = useState(null)
  const [dateRange, setDateRange] = useState([startDate, endDate])

  return (
    <>
      <IconButton
        color="secondary"
        onClick={(e) => setAnchorEl(e.currentTarget)}
        aria-label="Open date picker"
      >
        <CalendarMonthOutlined />
      </IconButton>

      <Menu
        open={!!anchorEl}
        anchorEl={anchorEl}
        variant="menu"
        onClose={() => setAnchorEl(null)}
        PaperProps={{
          style: {
            padding: '16px',
            minWidth: '320px',
          },
        }}
      >
        <DateRangePicker
          dates={dateRange}
          onChange={(newDates) => {
            setDateRange(newDates)
            // Optionally close menu after selection
            // setAnchorEl(null);
          }}
        />
      </Menu>
    </>
  )
}

With Form State Management

import { useForm } from 'react-hook-form'
import { DateRangePicker } from 'datepckr'

function FilterForm() {
  const { control, handleSubmit } = useForm({
    defaultValues: {
      dateRange: [new Date(), new Date()],
    },
  })

  const onSubmit = (data) => {
    console.log('Selected date range:', data.dateRange)
  }

  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <DateRangePicker
        dates={dateRange}
        onChange={(dates) => {
          // Update your form state here
        }}
      />
      <button type="submit">Apply Filter</button>
    </form>
  )
}

Customization

Theme Customization

Datepckr supports CSS custom properties for easy theming:

.datepckr {
  --datepckr-primary: #1976d2;
  --datepckr-primary-hover: #1565c0;
  --datepckr-text: #333333;
  --datepckr-background: #ffffff;
  --datepckr-border: #e0e0e0;
  --datepckr-border-radius: 8px;
  --datepckr-font-family: 'Roboto', sans-serif;
}

Custom Styling with CSS Modules

import styles from './CustomDatePicker.module.css'
import { DateRangePicker } from 'datepckr'

return <DateRangePicker dates={dates} onChange={setDates} className={styles.customPicker} />
/* CustomDatePicker.module.css */
.customPicker {
  border: 2px solid #4caf50;
  border-radius: 12px;
  padding: 12px;
}

.customPicker :global(.datepckr-day-slot-selected) {
  background-color: #4caf50;
  color: white;
}

Localization

import { DateRangePicker } from 'datepckr';
import { ru, enUS, fr, de, ja } from 'date-fns/locale'

// Russian
<DateRangePicker locale={ru} />

// English (United States)
<DateRangePicker locale={enUS} />

// German (Germany)
<DateRangePicker locale={de} />

// French (France)
<DateRangePicker locale={fr} />

// Japanese (Japan)
<DateRangePicker locale={ja} />

Made with ❤️ by Gena Baibara