Date wheel
iOS-style wheels for day and time: drag, flick or scroll and it glides onto an entry; quick picks spin every reel.
oxyn add date-wheelrsx! {
DateWheel {
minute_step: 5,
title: Some("Send later".into()),
confirm: Some("Schedule".into()),
on_change: move |(day, time)| when.set((day, time)),
}
}Rendered from Rust at build time · goes live when visible
When to use
- "Send later" and "remind me" moments: pick a day and time with wheels, the way a phone does.
- Fast with a thumb, exact with a keyboard.
When not to use
- A field that opens the calendar in a popover: use Date picker instead.
- A time field with a list at a fixed step: use Time picker instead.
- Spin a 24-hour dial to pick a time and see which team cities are at work: use Time dial instead.
Installation
Date wheel is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add date-wheeluse crate::oxyn::{DateWheel, PRIMITIVES_CSS};Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{DateWheel, PRIMITIVES_CSS};
Usage
rsx! {
DateWheel {
minute_step: 5,
title: Some("Send later".into()),
confirm: Some("Schedule".into()),
on_change: move |(day, time)| when.set((day, time)),
}
}Examples
Datetime
Day, hour, minute and AM / PM.
Code
rsx! {
DateWheel {
minute_step: 5,
title: Some("Send later".into()),
confirm: Some("Schedule".into()),
on_change: move |(day, time)| when.set((day, time)),
}
}Date
Month, day and year.
Code
rsx! {
DateWheel {
mode: "date",
minute_step: 5,
title: Some("Send later".into()),
confirm: None,
on_change: move |(day, time)| when.set((day, time)),
}
}Time
Time only, 24-hour.
Code
rsx! {
DateWheel {
mode: "time",
minute_step: 5,
hour_cycle: "24",
title: Some("Send later".into()),
confirm: Some("Schedule".into()),
on_change: move |(day, time)| when.set((day, time)),
}
}Routine
Routine pick and words (Oxyn plus).
Code
rsx! {
DateWheel {
minute_step: 5,
title: Some("Send later".into()),
routine: true,
natural: true,
confirm: Some("Schedule".into()),
on_change: move |(day, time)| when.set((day, time)),
}
}API reference
DateWheel
| Prop | Type | Default | Description |
|---|---|---|---|
mode | String | "datetime" | `datetime` · `date` · `time`. |
date | String | "2026-09-24" | Starting day (ISO). |
time | String | "09:30" | Starting time (`HH:mm`). |
today | String | "2026-09-24" | Today (ISO). |
minute_step | u32 | 5 | Minutes between minute entries. |
hour_cycle | String | "12" | `12` · `24`. |
title | Option<String> | Default::default() | Heading above the summary. |
presets | bool | true | Show quick picks. |
routine | bool | Default::default() | Oxyn plus: a weekday-routine pick ("Weekdays 9:00"). |
confirm | Option<String> | Default::default() | Confirm button label (`None` hides it). |
speed | f32 | 1.0 | Glide speed multiplier. |
natural | bool | Default::default() | Oxyn plus: type a moment in words. |
label | String | "Date and time" | Accessible name. |
on_change | EventHandler<(String, String)> | — | Came to rest on a new moment: `(ISO date, HH:mm)`. |
on_confirm | EventHandler<(String, String)> | — | Confirmed. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Between reels, the quick picks and the button |
| ↑or↓ | Turn the focused reel one entry |
| Page UporPage Down | A week of days, 3 or 6 hours, 15 minutes, 10 years |
| HomeorEnd | First / last entry |
| Type | Jump: 4 for 4 o'clock, 45 for :45, p for PM, ma for March |
Accessibility
- A named group; each reel is a spinbutton (Day, Hour, Minute, AM or PM) with an aria-valuetext such as “Fri, Sep 25”.
- The full moment is announced once the reels rest; quick picks use aria-pressed.
- Dates that don't exist (February 30) are dimmed and the day reel turns back by itself.
From the spec
A named group; each reel is a focusable spinbutton (Day, Hour, Minute, AM or PM / Month, Date, Year) with aria-valuenow and a spoken aria-valuetext ("Fri, Sep 25"). The full moment is announced politely once the reels rest. Quick picks use aria-pressed. Invalid days are dimmed and never selected.
Motion & interaction
Each reel is projected onto a cylinder (20° per entry, fading toward the back). Flicks keep their momentum and land on an entry through a critically damped spring, so the stop never overshoots. Keyboard steps add to the motion rather than restarting it. The summary ("Tomorrow at 9:30 AM") and the relative phrase update when the reels rest.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Glide (web) | 220 ms + 45 ms per row, ≤ 900 ms, ÷ speed | cubic-bezier(.2,.9,.25,1) | lands at once |
| Spring (core) | ω = 16 × speed | critically damped | lands at once |
| Rubber band | 0.55 coefficient, 1.5 rows max | — | — |
| Type-ahead window | 1,000 ms | — | — |
| Confirm success | 900 ms pending (demo), 1.6 s shown | — | same |
Responsive behaviour
- Fits a 320 px phone; reels size to their widest entry under one lens.
- Below 480 px the confirm button goes full width and 44 px tall.
Edge cases (spec)
Days default to 30 days back and a year ahead (date mode: 100 years back, 10 on). Minute values off the step land on the step below. Leap years in date mode. 320 px phones fit; reels size to their widest entry. Below 480 px the confirm button is full width and 44 px tall. Wheel / trackpad scroll turns one entry per notch.
Notes for AI
- Import
DateWheelfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
DateWheelElinoxyn_gpui. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.