Skip to content
Back

Calendar

A compact month view for one date: months slide the way you travel, the selection moves between days and arrows skip blocked days.

oxyn add calendar
MCP
November 2026
SuMoTuWeThFrSa
Dioxus
rsx! {
    Calendar {
        value: Some(day()),
        today: today_iso(),
        week_starts_on: 0,
        show_today: true,
        on_change: move |iso: String| day.set(iso),
    }
}

Rendered from Rust at build time · goes live when visible

When to use

  • A compact month view to pick one date: a due date, a run schedule, a checkpoint day.
  • Also the grid inside the date picker and the range picker.

When not to use

  • A field that opens the calendar in a popover: use Date picker 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.
  • iOS-style wheels for day and time: use Date wheel instead.

Installation

Calendar 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.

Terminal
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add calendar
Rust
use crate::oxyn::{Calendar, PRIMITIVES_CSS};

Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{Calendar, PRIMITIVES_CSS};

Usage

Dioxus · rust
rsx! {
    Calendar {
        value: Some(day()),
        today: today_iso(),
        week_starts_on: 0,
        show_today: true,
        on_change: move |iso: String| day.set(iso),
    }
}

Examples

Default

One date with a Today button.

November 2026
SuMoTuWeThFrSa
Code
rsx! {
    Calendar {
        value: Some(day()),
        today: today_iso(),
        week_starts_on: 0,
        show_today: true,
        on_change: move |iso: String| day.set(iso),
    }
}

Weekdays

Weekends blocked, Monday first.

November 2026
MoTuWeThFrSaSu
Code
rsx! {
    Calendar {
        value: Some(day()),
        today: today_iso(),
        blocked: "weekends",
        week_starts_on: 1,
        show_today: true,
        on_change: move |iso: String| day.set(iso),
    }
}

Bounded

Min and max.

November 2026
SuMoTuWeThFrSa
Code
rsx! {
    Calendar {
        value: Some(day()),
        today: today_iso(),
        week_starts_on: 0,
        show_today: true,
        on_change: move |iso: String| day.set(iso),
    }
}

Heat

Run history per day (Oxyn plus).

November 2026
WkSuMoTuWeThFrSa
45
46
47
48
49
50
Code
rsx! {
    Calendar {
        value: Some(day()),
        today: today_iso(),
        week_starts_on: 0,
        show_today: true,
        week_numbers: true,
        on_change: move |iso: String| day.set(iso),
    }
}

API reference

Calendar

PropTypeDefaultDescription
valueOption<String>Default::default()Picked date (ISO).
todayString"2026-11-13"Today (ISO); pass it so server and client agree.
minOption<String>Default::default()Earliest day (ISO).
maxOption<String>Default::default()Latest day (ISO).
blockedString"none"`none` · `weekends`.
week_starts_onu8Default::default()0 = Sunday, 1 = Monday.
show_todayboolDefault::default()Today button.
week_numbersboolDefault::default()Oxyn plus: ISO week numbers.
activityVec<(String, u8)>Default::default()Oxyn plus: activity per day `(ISO, 0–4)`.
labelString"Calendar"Accessible name.
on_changeEventHandler<String>—Picked.
on_month_changeEventHandler<String>—Month changed (first of the month, ISO).

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
Arrow keysOne day or one week, skipping blocked days and crossing months
HomeorEndStart / end of the week
Page UporPage DownA month (Shift: a year)
EnterorSpacePick the focused day

Accessibility

  • Days sit in a role=grid; each day is a gridcell button with its full date as its name, aria-selected and aria-current=date for today.
  • One tab stop (aria-activedescendant); the month title is announced when it changes.
  • Pagers are labelled and aria-disabled at min or max.
From the spec

One focusable role=grid with aria-activedescendant (a single tab stop); weekday headers are columnheaders with full names. The month title is a polite live region. Pagers are labelled and aria-disabled at bounds. Keys follow the APG date-grid pattern.

Motion & interaction

Months slide in from the side you're travelling to (later → from the right). The title rolls. The selection moves between days on a snap. The Today button jumps and slides like a page.

Timing
TransitionDurationEasingReduced motion
Month slide240 ms, 20 pxease.out1 ms
Title roll220 msease.outswap
Selection214 ms spring.snap colourspringinstant
Hover120 msease.out80 ms

Responsive behaviour

  • min(100%, 328 px) wide; days are square cells that scale.
  • Below 260 px the title takes its own row.
Edge cases (spec)

Leap years and month ends (31 Jan + 1 month = 28/29 Feb). A value outside min / max shows but can't be re-picked. Six-row months keep the grid height steady. Narrow containers (< 260 px): the title takes its own row. Tiny panels: cells stay square and scale. RTL: the grid mirrors, ← moves to the next day visually.

Notes for AI

  • Import Calendar from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: CalendarEl 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