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

lattice-react-datepicker

v0.1.9

Published

Lattice Date Picker — React & Next.js date and range picker with presets, optional time, Tailwind-ready UI, CSS-variable theming, keyboard + screen-reader friendly. TypeScript, ESM+CJS, tree-shakeable.

Readme

Lattice Date Picker

React · Next.js · TypeScript · Tailwind CSS

A modern calendar and date / range / multi picker with optional time, preset ranges, CSS-variable theming, and accessible keyboard + screen-reader support. Built for React 18+ and works in Next.js App Router (client components), Pages Router, Vite, Remix, and plain CRA-style setups.

Why Lattice

| You get | Details | | -------- | -------- | | Next.js-ready | Uses client hooks — add "use client" once in App Router | | Modes | Single date, full range, multiple selection | | Time | Optional start/end time on range; standalone TimePicker export | | Tailwind-native | Utility classes + classNames slots; ship a polished default via theme.css | | Theme control | --dp-* tokens, themeVars, or override .datepicker-root | | Headless hooks | useDatePicker, useCalendar for custom UIs | | Ship weight | ESM + CJS, TypeScript types, tree-shakeable entry points |

Discoverability on npm also depends on stars, downloads, and links over time — clear docs and keywords help people find the package; growth comes from real adoption.


Install

npm install lattice-react-datepicker

Peers:

npm install react react-dom

Styles: import the theme once (uses CSS variables under .datepicker-root):

@import "lattice-react-datepicker/theme.css";

Tailwind: ensure JIT scans the library output so arbitrary classes resolve:

// tailwind.config.js
export default {
  content: [
    "./src/**/*.{js,ts,jsx,tsx}",
    "./node_modules/lattice-react-datepicker/dist/**/*.{js,cjs,mjs}",
  ],
};

Next.js (App Router)

  1. Mark the file (or a thin wrapper) as a client component:
"use client";
  1. Import the package + theme.css as in the examples below.

  2. Server Components: keep DatePicker in a leaf client file; pass serializable props from server parents if needed.


Quick start

Single date

"use client";

import { useState } from "react";
import { DatePicker } from "lattice-react-datepicker";
import "lattice-react-datepicker/theme.css";

export function SingleExample() {
  const [value, setValue] = useState<Date | null>(null);

  return (
    <DatePicker
      mode="single"
      value={value}
      onChange={(v) => setValue(v as Date | null)}
      aria-label="Choose a date"
    />
  );
}

Range — presets, time, Apply / Cancel

"use client";

import { useState } from "react";
import { DatePicker, createCommonPresets } from "lattice-react-datepicker";
import "lattice-react-datepicker/theme.css";

export function RangeExample() {
  const [value, setValue] = useState<{ start: Date | null; end: Date | null }>({
    start: null,
    end: null,
  });

  return (
    <DatePicker
      mode="range"
      value={value}
      onChange={(v) => setValue(v as { start: Date | null; end: Date | null })}
      presets={createCommonPresets()}
      showTime
      use12HourClock
      onApply={() => undefined}
      onCancel={() => undefined}
      aria-label="Choose a date range"
    />
  );
}

Multiple dates

"use client";

import { useState } from "react";
import { DatePicker } from "lattice-react-datepicker";
import "lattice-react-datepicker/theme.css";

export function MultipleExample() {
  const [value, setValue] = useState<Date[]>([]);

  return (
    <DatePicker
      mode="multiple"
      value={value}
      onChange={(v) => setValue(v as Date[])}
      aria-label="Choose dates"
    />
  );
}

Time only (subpath)

import { TimePicker } from "lattice-react-datepicker/time";

Theming

<DatePicker
  themeVars={{
    "--dp-primary": "#6366f1",
    "--dp-accent": "#a855f7",
    "--dp-radius-lg": "24px",
  }}
/>
import { getDefaultDatepickerRootStyle, DATEPICKER_CSS_VARS } from "lattice-react-datepicker";

Override tokens on .datepicker-root or fork theme.css.


Custom layout

<DatePicker
  className="max-w-md"
  classNames={{
    root: "shadow-2xl",
    presetButton: "rounded-lg",
    dayCell: "",
  }}
/>

renderDay, renderHeader, renderFooter for full composition.


Development (this repo)

| Command | Purpose | | -------------------- | ------------- | | pnpm install | Dependencies | | pnpm run build | Build dist/ | | pnpm run dev | Watch build | | pnpm test | Tests | | pnpm run storybook | UI demos |


License

MIT