---
title: "DateRangePicker コンポーネント — zenit Zig UI"
description: "開始日と終了日を選びます。範囲の順序、2 つの入力の状態、カレンダーのハイライト、オーバーレイのライフサイクルを一つのコンポーネントが調整します。"
url: https://zenit.z.express/ja/components/daterange
language: ja
alternate_en: https://zenit.z.express/components/daterange.md
alternate_zh: https://zenit.z.express/zh/components/daterange.md
alternate_es: https://zenit.z.express/es/components/daterange.md
alternate_ko: https://zenit.z.express/ko/components/daterange.md
alternate_fr: https://zenit.z.express/fr/components/daterange.md
alternate_de: https://zenit.z.express/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`

開始日と終了日を選びます。

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

**BEHAVIOR CONTRACT**

範囲の順序、2 つの入力の状態、カレンダーのハイライト、オーバーレイのライフサイクルを一つのコンポーネントが調整します。

**RECORDED INTERACTION**

harness が「Start date」をクリックし、範囲カレンダーが開きます。

`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;
}
```

[GitHub でソースを見るexamples/storybook/stories.zig:2469](https://github.com/version-next/zenit/blob/HEAD/examples/storybook/stories.zig#L2469)

Storybook にあるこの story のコードそのままです（zenit 5f9add5+wip 2026-09-30）。`W` は `ui.widgets` のことで、`col` / `row` / `label` は Storybook 内の小さなレイアウトヘルパーです。

### 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
```

| フィールド | 型 | デフォルト値 | 説明 |
| --- | --- | --- | --- |
| `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)

| フィールド | 型 | デフォルト値 | 説明 |
| --- | --- | --- | --- |
| `wrapper` | `*Node` | — | — |
| `state` | `*DateRangePickerState` | — | — |
