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

@punaro/react-datepicker

v0.0.3

Published

A lightweight, accessible React date picker component

Readme

@punaro/react-datepicker

A lightweight, accessible, and fully customizable React date picker component. Mobile-first, no calendar popup, and easy to style or theme.


Features

  • Segmented input: Day, month, year as separate fields (keyboard and mobile friendly)
  • No calendar popup: Just type or pick from dropdowns
  • Dropdowns: Optional, with custom icon support
  • Dark/light themes: Built-in, or use your own
  • Outlined/flat/plain: Choose your look
  • Full style control: CSS file, slot-level class/style props, or zero-style mode
  • TypeScript: Full types for all props and slots
  • Zero dependencies (except date-fns)

Installation

npm install @punaro/react-datepicker

Live Demo & Playground →

Usage

import { useState } from "react";
import { DatePicker } from "@punaro/react-datepicker";
import "@punaro/react-datepicker/styles.css";

function App() {
  const [date, setDate] = useState<Date | undefined>();
  return <DatePicker value={date} onChange={setDate} />;
}

Props

| Prop | Type | Default | Description | | ------------- | ------------------------------------------------------- | -------------- | -------------------------------------------------------------------------- | | value | Date \| undefined | — | The selected date (controlled) | | onChange | (date: Date \| undefined) => void | — | Called when a valid date is entered/selected, or undefined if incomplete | | dateFormat | string | 'dd/MM/yyyy' | Format string using dd, MM, yyyy tokens (order/separator flexible) | | disabled | boolean | false | Disables all inputs and dropdowns | | showDropdowns | boolean | false | Show dropdown icon next to each segment (native select for mobile/desktop) | | dropdownIcon | ReactNode \| (segment: 'dd'\|'MM'\|'yyyy')=>ReactNode | '▾' | Custom icon for dropdown trigger (single or per-segment) | | maxYear | number | current year | Latest year in year dropdown | | yearRange | number | 100 | How many years to show in year dropdown | | theme | 'light' \| 'dark' | 'light' | Color theme (CSS variables, only if not isPlainStyle) | | outlined | boolean | false | Draw a single border around the whole component | | isPlainStyle | boolean | false | No built-in styles or classes; style from scratch | | classNames | Partial<Record<StyleSlot, string>> | — | Add/override classes for any slot (see below) | | styles | Partial<Record<StyleSlot, CSSProperties>> | — | Add/override inline styles for any slot |

StyleSlot values

  • root, segment, input, separator, trigger, dropdownIcon, select

Examples

Basic

<DatePicker value={date} onChange={setDate} />

Custom format

<DatePicker value={date} onChange={setDate} dateFormat="MM-yyyy-dd" />

With dropdowns

<DatePicker value={date} onChange={setDate} showDropdowns />

Custom dropdown icon (emoji)

<DatePicker value={date} onChange={setDate} showDropdowns dropdownIcon="📅" />

Custom dropdown icon (SVG)

<DatePicker
  value={date}
  onChange={setDate}
  showDropdowns
  dropdownIcon={
    <svg width="10" height="10" viewBox="0 0 10 10">
      <path
        d="M1 3l4 4 4-4"
        stroke="currentColor"
        strokeWidth="1.5"
        strokeLinecap="round"
        strokeLinejoin="round"
      />
    </svg>
  }
/>

Per-segment dropdown icon

<DatePicker
  value={date}
  onChange={setDate}
  showDropdowns
  dropdownIcon={(seg) => (seg === "dd" ? "📆" : seg === "MM" ? "🗓️" : "⏳")}
/>

Outlined (single-field look)

<DatePicker value={date} onChange={setDate} showDropdowns outlined />

Dark theme

<DatePicker
  value={date}
  onChange={setDate}
  showDropdowns
  outlined
  theme="dark"
/>

Plain (no styles)

<DatePicker value={date} onChange={setDate} showDropdowns isPlainStyle />

Custom styles via classNames/styles

<DatePicker
  value={date}
  onChange={setDate}
  showDropdowns
  outlined
  classNames={{
    root: "custom-root",
    input: "custom-input",
    dropdownIcon: "custom-icon",
    trigger: "custom-trigger",
    segment: "custom-segment",
    separator: "custom-sep",
    select: "custom-select",
  }}
  styles={{
    root: { background: "#f0f9ff", borderColor: "#38bdf8" },
    input: { color: "#0ea5e9", fontWeight: 600 },
    dropdownIcon: { color: "#0ea5e9", fontSize: 16 },
    trigger: { background: "#bae6fd" },
    segment: { marginRight: 2 },
    separator: { color: "#38bdf8" },
    select: { minWidth: 24 },
  }}
/>

Theming & Styling

  • Import the CSS file for default styles:
    import "@punaro/react-datepicker/styles.css";
  • Use the theme prop for dark/light, or override CSS variables on .rdp-root for custom themes.
  • Use classNames/styles for slot-level overrides.
  • Use isPlainStyle for zero-style mode (all classes/inline styles removed).

License

MIT