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 🙏

© 2025 – Pkg Stats / Ryan Hefner

harpreet-calender

v1.0.1

Published

A modern, customizable React DatePicker component with single and range selection support

Readme

Harpreet Calendar

A modern, customizable React DatePicker component with single and range selection support, built with TypeScript, date-fns, and Tailwind CSS.

Features

  • ✅ Single date selection
  • ✅ Date range selection
  • ✅ Internationalization support (English & German)
  • ✅ Min/Max date constraints
  • ✅ Customizable styling
  • ✅ TypeScript support
  • ✅ Fully accessible
  • ✅ Portal-based dropdown (prevents overflow issues)

Installation

npm install harpreet-calender
# or
yarn add harpreet-calender
# or
pnpm add harpreet-calender

Peer Dependencies

Make sure you have these installed:

npm install react react-dom date-fns react-i18next

Usage

Basic Single Date Picker

import { DatePicker } from 'harpreet-calender';
import { useState } from 'react';

function App() {
  const [date, setDate] = useState<string | null>(null);

  return (
    <DatePicker
      mode="single"
      value={date}
      onChange={setDate}
      placeholder="Select a date"
    />
  );
}

Date Range Picker

import { DatePicker } from 'harpreet-calender';
import { useState } from 'react';

function App() {
  const [dateRange, setDateRange] = useState<{ start: string; end: string } | null>(null);

  return (
    <DatePicker
      mode="range"
      value={dateRange}
      onChange={setDateRange}
      placeholder="Select date range"
    />
  );
}

With Min/Max Dates

<DatePicker
  mode="single"
  value={date}
  onChange={setDate}
  minDate={new Date('2024-01-01')}
  maxDate={new Date('2024-12-31')}
  label="Select a date"
  required
/>

With Custom Styling

<DatePicker
  mode="single"
  value={date}
  onChange={setDate}
  className="custom-input-class"
  placeholder="Pick a date"
/>

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | mode | 'single' \| 'range' | 'single' | Selection mode | | value | string \| { start: string; end: string } \| null | null | Current selected value (YYYY-MM-DD format) | | onChange | (value: string \| { start: string; end: string } \| null) => void | - | Callback when date changes | | placeholder | string | 'Select date' | Input placeholder text | | className | string | '' | Additional CSS classes for input | | disabled | boolean | false | Disable the date picker | | minDate | Date | - | Minimum selectable date | | maxDate | Date | - | Maximum selectable date | | label | string \| React.ReactNode | - | Label for the input | | required | boolean | false | Show required indicator |

Internationalization

The component uses react-i18next for internationalization. Make sure you have i18n configured in your app:

import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';

i18n
  .use(initReactI18next)
  .init({
    resources: {
      en: { translation: {} },
      de: { translation: {} }
    },
    lng: 'en',
    fallbackLng: 'en',
  });

Styling

This component uses Tailwind CSS classes. Make sure Tailwind is configured in your project. The component uses the following color utilities that you can customize in your tailwind.config.js:

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      colors: {
        primary: {
          100: '#your-color',
          500: '#your-color',
          600: '#your-color',
          700: '#your-color',
        }
      }
    }
  }
}

License

MIT

Author

Harpreet Kumar

Repository

GitHub Repository