New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@gentleduck/calendar

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gentleduck/calendar

Headless, framework-agnostic calendar engine with date adapter pattern.

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

@gentleduck/calendar

Headless, framework-agnostic calendar engine with date adapter pattern, React hooks, and compound components.

75% smaller than react-day-picker - ~5 KB gzipped vs ~20 KB. Zero dependencies. Full keyboard navigation and ARIA compliance.

Benchmarks

LibrarySize (gzipped)Dependencies
@gentleduck/calendar~5 KB0
react-day-picker~20 KBdate-fns
react-calendar~18 KB0
react-datepicker~38 KBdate-fns, react-popper
react-aria (DatePicker)~45 KB@internationalized/date + 5 more

4 calendar systems (Gregorian, Islamic, Persian, Hebrew). 7 date adapters (Native, date-fns, dayjs, luxon + 3 calendar-specific). See the full benchmarks for feature comparisons.

bun run benchmark

Quick Start

import { NativeAdapter, useCalendar } from '@gentleduck/calendar'

const adapter = new NativeAdapter()

function MyCalendar() {
  const { state, getDayProps, getGridProps } = useCalendar({
    adapter,
    mode: 'single',
  })

  return (
    <div {...getGridProps()}>
      {state.weeks.map(week =>
        week.days.map(day => (
          <button key={day.date.getTime()} {...getDayProps(day)}>
            {day.date.getDate()}
          </button>
        ))
      )}
    </div>
  )
}

Features

  • Date Adapter Pattern - Plug in any date library (native Date, dayjs, date-fns, Temporal)
  • Selection Modes - Single, range, multi-select with type-safe conditional types
  • Multi-Month - Display 1-12 months side by side
  • Time Picker - useTimePicker hook with spinbutton ARIA
  • DateTime Picker - useDateTime composing calendar + time
  • Keyboard Navigation - Arrow keys, Page Up/Down, Home/End, Enter/Space, Escape
  • Screen Reader - aria-live announcements for navigation and selection
  • Roving TabIndex - Proper focus management with DOM focus sync
  • Zero CSS - Style with data-* attributes using Tailwind, CSS modules, or vanilla CSS
  • Tree-Shakeable - sideEffects: false, import only what you use

Architecture

@gentleduck/calendar
├── adapter/      -  DateAdapter<TDate> interface + NativeAdapter
├── grid/         -  buildCalendarMonth, buildMultiMonth, year/decade views
├── selection/    -  selectDay, applySelection, range/multi logic
├── navigation/   -  navigate, canNavigate, month/year jumping
├── time/         -  TimeValue, clampTime, incrementField, formatters
└── react/        -  useCalendar, useTimePicker, useDateTime, useKeyboard, useAnnouncer

Documentation

Full docs at gentleduck.org/docs/packages/duck-calendar

License

MIT

Keywords

gentleduck

FAQs

Package last updated on 26 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts