Skip to content
Hazine

Date range pickers

1 of 5 shipped. Each take is a different structure, and the note under its title says how.

  • date range pickers

    Two typed fields over one calendar: the focused field decides which end a click sets, a dashed band previews it, a pick on the wrong side swaps the ends, and one message reports cross field errors.

    shadcn add @hazine/date-range-two-fields

    Depends on calendar, popover, @hazine/use-controllable-state, lucide-react

Planned 4

  • Date range picker with preset rail

    The preset is the primary choice and the calendar is secondary: the trigger shows the preset name when one is active and the literal dates when custom. Changes are staged and need Apply, with Cancel restoring the previous range, so charts do not refetch on every click. The rail is a radio group and turns into a select above the calendar on small screens.

  • Date range picker with comparison period

    Two ranges in one calendar: the primary band is solid, the comparison band is outlined with a dashed edge so the two are distinct without relying on colour. The comparison range is derived and updates when the primary changes, unless set to custom. The trigger shows both ranges on two lines and a footer states the day counts of each so mismatched lengths are visible.

  • Stay date range picker with night limits

    Selection is constrained by the first click: after check-in is chosen, days that would break the minimum or maximum stay or cross a booked night become unavailable with a text reason, and days that are valid only for check-out are marked as such. A footer row states the rule ('Minimum 2 nights') and then the result ('4 nights, 12 to 16 November'). Two step keyboard flow with Escape resetting to step one.

  • Period stepper

    No free range selection: the range is always one whole period and the user steps through time. The label ('Week 46, 9 to 15 Nov 2026') is a button that opens a small calendar to jump, a Today button appears only when the current period is not shown, and next is disabled at a max date. Left and right arrow keys step while the label has focus.