---
title: "DateRangePicker component | zenit Zig UI"
description: "Pick a start and an end date. Range order, both inputs, calendar highlighting and overlay lifetime are coordinated by one component."
url: https://ui.surf/zenit/components/daterange
language: en
alternate_zh: https://ui.surf/zenit/zh/components/daterange.md
alternate_es: https://ui.surf/zenit/es/components/daterange.md
alternate_ja: https://ui.surf/zenit/ja/components/daterange.md
alternate_ko: https://ui.surf/zenit/ko/components/daterange.md
alternate_fr: https://ui.surf/zenit/fr/components/daterange.md
alternate_de: https://ui.surf/zenit/de/components/daterange.md
project: zenit v0.1.0-alpha (Zig 0.15.2, macOS)
source: https://github.com/version-next/zenit
---

# DateRangePicker

`ui.widgets.DateRangePicker`

Pick a start and an end date.

[Video](https://ui.surf/zenit/media/stories/daterange.mp4?v=ce0dbf06cf)

**BEHAVIOR CONTRACT**

Range order, both inputs, calendar highlighting and overlay lifetime are coordinated by one component.

**RECORDED INTERACTION**

The harness clicks “Start date” and the range calendar opens.

`examples/storybook/stories.zig:2469`

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

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

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.

### DateRangePickerProps

`ui.widgets.DateRangePicker`

[src/ui/components/date\_range\_picker/mod.zig:27](https://github.com/version-next/zenit/blob/HEAD/src/ui/components/date_range_picker/mod.zig#L27)

```zig
fn DateRangePicker(props: DateRangePickerProps) DateRangePickerBuilder
```

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `placeholder_start` | `[]const u8` | `"Start date"` | — |
| `placeholder_end` | `[]const u8` | `"End date"` | — |
| `start_date` | `?SimpleDate` | `null` | — |
| `end_date` | `?SimpleDate` | `null` | — |
| `initial_year` | `u16` | `2025` | — |
| `initial_month` | `u8` | `1` | — |
| `width` | `f32` | `320` | — |
| `size` | `theme.ControlSize` | `.md` | 控件尺寸（与 Button / Input / Select 同一 ControlSize，默认 md） |
| `disabled` | `bool` | `false` | — |
| `on_change` | `?core.HandlerRef` | `null` | — |
| `calendar_icon_asset` | `?svg_assets.Asset` | `null` | — |
| `prev_icon_asset` | `?svg_assets.Asset` | `null` | — |
| `next_icon_asset` | `?svg_assets.Asset` | `null` | — |
| `test_id` | `?[]const u8` | `null` | — |

### DateRangePickerResult

`ui.widgets.DateRangePicker`

[src/ui/components/date\_range\_picker/mod.zig:133](https://github.com/version-next/zenit/blob/HEAD/src/ui/components/date_range_picker/mod.zig#L133)

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