Skip to content
Back

Date Range PickerPro

Presets and two months with a hover preview after the first click, comparison with the previous period or year, Apply and Cancel.

oxyn add date-range-picker
The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

Rendered from Rust at build time · goes live when visible

When to use

  • Choose a span for usage, runs, cost or logs, often compared with the span before it.
  • The user starts from a preset most of the time and fine-tunes with two clicks.

When not to use

  • A compact month view for one date: use Calendar instead.
  • A field that opens the calendar in a popover: use Date picker instead.
  • On or off for things that apply right away: use Switch instead.

Installation

Date Range Picker is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.

Terminal
oxyn add date-range-picker

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Two months

Presets, two months and the comparison.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

One month

One month, no comparison.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Year

Compared with last year.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Closed

The trigger with its range.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

DateRangePicker

PropTypeDefaultDescription
labelString"Date range"Accessible name of the trigger and the dialog.
startOption<String>Default::default()Starting range start (ISO).
endOption<String>Default::default()Starting range end (ISO).
placeholderString"Select dates"Placeholder.
todayString"2026-11-13"Today (ISO); reference for presets.
comparebooltrueOffer the comparison control.
default_compareString"previous"`off` · `previous` · `year`.
week_starts_onu810 = Sunday, 1 = Monday.
monthsu82`1` · `2` months.
minOption<String>Default::default()Earliest day.
maxOption<String>Default::default()Latest day (default: today).
default_openboolDefault::default()Open right away.
on_changeEventHandler<RangeValue>—Applied: `(start, end, compare start, compare end)` as ISO.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterorSpaceOpen; in the grid pick a start, then an end
Arrow keysMove by day or week; once a start is picked the preview follows
HomeorEndStart / end of the week
Page UporPage DownA month (Shift: a year)
EscClose without applying

Accessibility

  • The trigger opens a dialog and its name includes the current range.
  • Each month is a grid; days have full dates, aria-selected inside the range and aria-current for today.
  • A polite region announces the start, then the range and its length.
From the spec

The trigger's name includes the current range. Each month is a grid with full-date cells, aria-selected for every day inside the range and aria-current for today. A polite region announces "Start Oct 15, pick an end" and then the range with its length. Compare is a radiogroup.

Motion & interaction

The panel grows from the trigger. Months slide when paging. The band grows to the hovered day. The trigger label rolls on Apply. The preset rail highlight moves to the matching preset (or none for a custom range).

Timing
TransitionDurationEasingReduced motion
Panel in220 msease.out80 ms fade
Band / preview120 ms colourease.outinstant
Month slide240 msease.out1 ms
Trigger roll220 msease.outswap

Responsive behaviour

  • Below 600 px the presets become a scrolling row of chips and one month shows; the footer stacks.
  • The panel is as wide as the screen allows, up to 652 px.
Edge cases (spec)

Reverse picks (end before start) are ordered. Ranges across a year show both years. Comparison for leap days clamps. Very narrow (< 600 px): presets become a scrolling chip row, one month shows, the footer stacks. Max today: future days are disabled.

Notes for AI

  • Import DateRangePicker from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: RangePickerEl in oxyn_gpui.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI