---
title: "Calendar component | zenit Zig UI"
description: "Month-view date browsing and selection. Month math, first-week offset, selection and navigation share the SimpleDate model."
url: https://ui.surf/zenit/components/calendar
language: en
alternate_zh: https://ui.surf/zenit/zh/components/calendar.md
alternate_es: https://ui.surf/zenit/es/components/calendar.md
alternate_ja: https://ui.surf/zenit/ja/components/calendar.md
alternate_ko: https://ui.surf/zenit/ko/components/calendar.md
alternate_fr: https://ui.surf/zenit/fr/components/calendar.md
alternate_de: https://ui.surf/zenit/de/components/calendar.md
project: zenit v0.1.0-alpha (Zig 0.15.2, macOS)
source: https://github.com/version-next/zenit
---

# Calendar

`ui.widgets.Calendar`

Month-view date browsing and selection.

[Video](https://ui.surf/zenit/media/stories/calendar.mp4?v=3b86846183)

**BEHAVIOR CONTRACT**

Month math, first-week offset, selection and navigation share the SimpleDate model.

**RECORDED INTERACTION**

The harness clicks the 18th and the selection moves.

`examples/storybook/stories.zig:2457`

```zig
// ── Calendar ──
pub fn buildCalendar(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
    const cal = try W.Calendar(.{ .initial_year = 2026, .initial_month = 5 }).mount(scope, cx);
    return cal.wrapper;
}
```

[View source on GitHubexamples/storybook/stories.zig:2457](https://github.com/version-next/zenit/blob/HEAD/examples/storybook/stories.zig#L2457)

The story's verbatim source from the Storybook (zenit 4c50245 2026-10-01). `W` is `ui.widgets`; `col` / `row` / `label` are small Storybook layout helpers.

### CalendarProps

`ui.widgets.Calendar`

[src/ui/components/calendar/mod.zig:42](https://github.com/version-next/zenit/blob/HEAD/src/ui/components/calendar/mod.zig#L42)

```zig
fn Calendar(props: CalendarProps) CalendarBuilder
```

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `initial_year` | `u16` | `2025` | — |
| `initial_month` | `u8` | `1` | — |
| `selected_date` | `?SimpleDate` | `null` | — |
| `on_select` | `?core.HandlerRef` | `null` | — |
| `cell_size` | `f32` | `36` | — |
| `prev_icon_asset` | `?svg_assets.Asset` | `null` | — |
| `next_icon_asset` | `?svg_assets.Asset` | `null` | — |

### CalendarResult

`ui.widgets.Calendar`

[src/ui/components/calendar/mod.zig:201](https://github.com/version-next/zenit/blob/HEAD/src/ui/components/calendar/mod.zig#L201)

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `wrapper` | `*Node` | — | — |
| `state` | `*CalendarState` | — | — |
