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

@kenos-ui/react-datepicker

v0.5.0

Published

Headless date & scheduling primitives for React — Kenos UI DatePicker

Readme

@kenos-ui/react-datepicker

Headless date & scheduling primitives for React.

Built on native Intl, timescape (segmented inputs), and Floating UI. Full keyboard navigation, WAI-ARIA patterns, and a focus on real-world composition.

  • Single, range, and multiple selection with one API (mode)
  • Outstanding segmented date input (<DatePicker.Input />)
  • Fully unstyled — bring your own CSS or Tailwind
  • Excellent keyboard + screen reader support
  • React 19+ and TypeScript-first

Installation

npm install @kenos-ui/react-datepicker

Quick start (with segmented input)

import { DatePicker } from "@kenos-ui/react-datepicker";

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

  return (
    <DatePicker.Root value={date} onValueChange={setDate}>
      <DatePicker.Label>Pick a date</DatePicker.Label>
      <div>
        <DatePicker.Input />
        <DatePicker.Trigger>📅</DatePicker.Trigger>
      </div>
      <DatePicker.Content>
        <DatePicker.Calendar />
      </DatePicker.Content>
    </DatePicker.Root>
  );
}

The <DatePicker.Input /> gives users a native-feeling segmented editor (month / day / year) that respects the locale's order and separators.

Date range

One of the strongest use cases:

import { DatePicker, type DateRange } from "@kenos-ui/react-datepicker";

function TripDates() {
  const [range, setRange] = useState<DateRange>({ start: null, end: null });

  return (
    <DatePicker.Root mode="range" value={range} onValueChange={setRange}>
      <DatePicker.Label>Trip dates</DatePicker.Label>
      <div>
        <DatePicker.Input index={0} />
        <span>to</span>
        <DatePicker.Input index={1} />
        <DatePicker.Trigger>📅</DatePicker.Trigger>
      </div>
      <DatePicker.Content>
        <DatePicker.Calendar />
      </DatePicker.Content>
    </DatePicker.Root>
  );
}

Range mode includes live hover preview between start and end.

Multiple dates

<DatePicker.Root mode="multiple" onValueChange={setDates}>
  <DatePicker.Input />
  <DatePicker.Trigger />
  <DatePicker.Content>
    <DatePicker.Calendar />
  </DatePicker.Content>
</DatePicker.Root>

Calendar composition

Use the convenient shorthand:

<DatePicker.Root>
  <DatePicker.Calendar />
</DatePicker.Root>

Or take full control:

<DatePicker.Root>
  <DatePicker.ViewControl>
    <DatePicker.PrevTrigger />
    <DatePicker.ViewTrigger />
    <DatePicker.NextTrigger />
  </DatePicker.ViewControl>

  <DatePicker.View view="day">
    <DatePicker.Grid header={<DatePicker.WeekDays />}>
      {({ weeks }) =>
        weeks.map((week, i) => (
          <tr key={i}>
            {week.map((d, j) => (
              <DatePicker.Day key={j} date={d}>
                {({ isSelected, isToday }) => (
                  // custom rendering
                  <span className={isSelected ? "selected" : ""}>{d.getDate()}</span>
                )}
              </DatePicker.Day>
            ))}
          </tr>
        ))
      }
    </DatePicker.Grid>
  </DatePicker.View>
</DatePicker.Root>

You can also render month/year grids with MonthGrid / YearGrid.

Positioning & advanced Content

<DatePicker.Content> is powered by Floating UI and supports:

  • side, align, sideOffset, alignOffset
  • portal
  • forceMount (for enter/exit animations via [data-state="open"])
  • avoidCollisions
<DatePicker.Content portal side="top" align="end" forceMount>
  <DatePicker.Calendar />
</DatePicker.Content>

Key props on Root

  • mode: "single" | "range" | "multiple"
  • locale, weekStartsOn
  • minDate, maxDate, disabled
  • readOnly
  • modal — opt-in focus trap + aria-modal (default false — follows popup policy)
  • defaultOpen, closeOnSelect

See the full prop tables and more examples in the project README.

Localization

Everything is driven by Intl.Locale:

<DatePicker.Root locale="pt-BR" />   {/* dd/mm/yyyy, week starts Monday */}
<DatePicker.Root locale="ar" />      {/* RTL + Saturday start */}
<DatePicker.Root locale="ja-JP" />

Requirements

  • React ≥ 19
  • Node ≥ 22

Exports

import {
  DatePicker,
  useDatePickerContext,
  // types
  type DatePickerRootProps,
  type DateRange,
  type DayCellMeta,
  // ...
} from "@kenos-ui/react-datepicker";

License

MIT


Kenos UI — https://github.com/allysontsoares/kenos-ui/tree/main/packages/datepicker