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-pickerThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
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.
oxyn add date-pickerUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Open
Calendar open under the field.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Closed
Just the field.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Words
“next tue”, “in 2 weeks” (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Presets
Today, Tomorrow, Next week (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
DatePicker
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | String | — | Label. |
value | Option<String> | Default::default() | Picked date (ISO). |
description | Option<String> | Default::default() | Helper copy. |
placeholder | String | "Select a date" | Placeholder. |
today | String | "2026-11-13" | Today (ISO). |
min | Option<String> | Default::default() | Earliest day. |
max | Option<String> | Default::default() | Latest day. |
blocked | String | "none" | `none` · `weekends`. |
format | String | "medium" | `medium` · `long` · `weekday` · `day-first` · `month-first` · `iso`. |
show_today | bool | Default::default() | Today button. |
natural | bool | Default::default() | Oxyn plus: type a date in words. |
presets | bool | Default::default() | Oxyn plus: relative presets (Today, Tomorrow, Next week). |
open | bool | Default::default() | Start open (review sheets). |
disabled | bool | Default::default() | Disabled. |
on_change | EventHandler<Option<String>> | — | Picked (or cleared: `None`). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| EnterorSpaceor↓ | Open and focus the picked or current day |
| Esc | Close and return to the field |
| Calendar keys | Arrows, 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
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Popover in | 200 ms, scale .97 → 1 | ease.out | 80 ms fade |
| Close after pick | 240 ms delay | — | 0 ms |
| Part roll | 220 ms, 0.6 em, blur 2 → 0 | ease.out | swap |
| Calendar | see 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
DatePickerfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
DatePickerElinoxyn_gpui. - Props to set first:
label. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.