Skip to content
Back

Date pickerPro

A field that opens the calendar in a popover; the changed parts of the date roll, and the popover closes just after a pick.

oxyn add date-picker
The agent works toward this date
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

  • A form field for one date — a due date, when a scheduled agent should start.
  • Closed it reads like a text field; open it shows the calendar.

When not to use

  • A compact month view for one date: use Calendar instead.
  • Presets and two months with a hover preview after the first click, comparison with the previous period or year, Apply and Cancel: use Date Range Picker instead.
  • A small label for one control: use Tooltip instead.

Installation

Date 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-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

Open

Calendar open under the field.

The agent works toward this date
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

Just the field.

The agent works toward this date
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

Words

“next tue”, “in 2 weeks” (Oxyn plus).

The agent works toward this date
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

Presets

Today, Tomorrow, Next week (Oxyn plus).

The agent works toward this date
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

DatePicker

PropTypeDefaultDescription
labelrequiredString—Label.
valueOption<String>Default::default()Picked date (ISO).
descriptionOption<String>Default::default()Helper copy.
placeholderString"Select a date"Placeholder.
todayString"2026-11-13"Today (ISO).
minOption<String>Default::default()Earliest day.
maxOption<String>Default::default()Latest day.
blockedString"none"`none` · `weekends`.
formatString"medium"`medium` · `long` · `weekday` · `day-first` · `month-first` · `iso`.
show_todayboolDefault::default()Today button.
naturalboolDefault::default()Oxyn plus: type a date in words.
presetsboolDefault::default()Oxyn plus: relative presets (Today, Tomorrow, Next week).
openboolDefault::default()Start open (review sheets).
disabledboolDefault::default()Disabled.
on_changeEventHandler<Option<String>>—Picked (or cleared: `None`).

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterorSpaceor↓Open and focus the picked or current day
EscClose and return to the field
Calendar keysArrows, Home, End, Page Up / Down as in the calendar

Accessibility

  • The trigger has aria-haspopup=dialog and aria-expanded; the popover is a dialog named “Due date calendar”.
  • The value lives in a visually hidden span; the rolling parts are aria-hidden.
From the spec

The trigger is a button labelled by the label and a hidden value; the rolling parts are aria-hidden. The popover is a dialog; focus moves into the grid and returns to the trigger on close. Esc closes from anywhere inside.

Motion & interaction

The popover grows from the trigger's corner. After a pick it waits 240 ms so the selection can land before closing. In the field, only the parts that changed (month, day, year) roll — up when the new date is later, down when earlier.

Timing
TransitionDurationEasingReduced motion
Popover in200 ms, scale .97 → 1ease.out80 ms fade
Close after pick240 ms delay—0 ms
Part roll220 ms, 0.6 em, blur 2 → 0ease.outswap
Calendarsee calendar.md

Responsive behaviour

  • The popover is min(320 px, 100vw − 32 px), left-aligned to the field.
  • Below 360 px it stretches to both field edges.
Edge cases (spec)

Words that don't parse show "Not a date yet" and change nothing. Parsed dates outside min / max are refused. Narrow screens (< 360 px): the popover stretches to both field edges. Long formats ellipsize in narrow fields. RTL: the popover anchors to the inline start.

Notes for AI

  • Import DatePicker from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: DatePickerEl in oxyn_gpui.
  • Props to set first: label.
  • 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