Date Picker

The form side of dates: a grid for picking a single date, multiple dates, or a range, plus the composition pattern for date fields. For readonly month views that display data — heatmaps, event grids, mini calendars — see Calendar.

Examples

Single date

June 2026

Range

June 2026
July 2026

Month and year dropdowns

June 2026

Disabled dates

June 2026

Date picker field

Overview

The picker grid is the Calendar component, which wraps react-day-picker v9 with Rogo styling. All DayPicker props pass through: selection modes, min/max dates, disabled matchers, multiple months, localization, and custom formatters.

tsx
import { Calendar } from "@rogo-technologies/ui/calendar";

const [date, setDate] = useState<Date | undefined>();

<Calendar mode="single" selected={date} onSelect={setDate} />;

Usage

Selection modes

mode controls what selected / onSelect operate on: a Date (single), a Date[] (multiple), or a DateRange (range).

tsx
import { Calendar, type DateRange } from "@rogo-technologies/ui/calendar";

const [range, setRange] = useState<DateRange | undefined>();

<Calendar mode="range" selected={range} onSelect={setRange} numberOfMonths={2} />;

Disabling dates

disabled accepts a Matcher or array of matchers — weekdays, ranges, predicates, or explicit dates.

tsx
<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
  disabled={[{ dayOfWeek: [0, 6] }, { before: new Date() }]}
/>

Month and year dropdowns

captionLayout="dropdown" replaces the caption label with month and year selects. Bound the years with startMonth / endMonth.

tsx
<Calendar
  mode="single"
  captionLayout="dropdown"
  startMonth={new Date(2000, 0)}
  endMonth={new Date(2035, 11)}
  selected={date}
  onSelect={setDate}
/>

Date picker field

There is intentionally no DatePicker component — compose Popover, Button, and Calendar.

tsx
<Popover open={open} onOpenChange={setOpen}>
  <PopoverTrigger asChild>
    <Button variant="outline" prefix={<IconCalendar1 />}>
      {date ? format(date, "PPP") : "Pick a date"}
    </Button>
  </PopoverTrigger>
  <PopoverContent className="w-auto p-0" align="start">
    <Calendar mode="single" selected={date} onSelect={selectDate} />
  </PopoverContent>
</Popover>

API

PropTypeDefaultDescription
mode"single" | "multiple" | "range"Selection behavior.
selectedDate | Date[] | DateRangeControlled selection (type follows mode).
onSelect(value) => voidSelection callback (type follows mode).
numberOfMonthsnumber1Months rendered side by side.
captionLayout"label" | "dropdown""label"Caption as text or month/year dropdowns.
disabledMatcher | Matcher[]Dates that can't be selected.
showOutsideDaysbooleantrueRender leading/trailing days of neighboring months.
startMonth / endMonthDateNavigation bounds (also bound the year dropdown).

All other react-day-picker props pass through unchanged.

Guidelines

Do

  • Use Calendar for anything that picks dates — it ships keyboard navigation and ARIA grid semantics from react-day-picker
  • Compose date picker fields from Popover + Button + Calendar
  • Bound the year dropdown with startMonth / endMonth when using captionLayout="dropdown"

Don't

  • Don't rebuild date selection on top of calendar-core — that's what Calendar is for
  • Don't reach for react-day-picker directly in apps; import from @rogo-technologies/ui/calendar so styling stays consistent
  • Don't use a picker for readonly month views — build those on Calendar's calendar-core utilities
PreviousCombobox
NextDialog
Made in NYC© 2026 Rogo Technologies Inc.