DateRangePicker
ui.widgets.DateRangePickerPick a start and an end date.
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.
// ── 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;
}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.DateRangePickerfn DateRangePicker(props: DateRangePickerProps) DateRangePickerBuilderField
Type
Default
Description
placeholder_start[]const u8"Start date"—
placeholder_end[]const u8"End date"—
start_date?SimpleDatenull—
end_date?SimpleDatenull—
initial_yearu162025—
initial_monthu81—
widthf32320—
sizetheme.ControlSize.md控件尺寸(与 Button / Input / Select 同一 ControlSize,默认 md)
disabledboolfalse—
on_change?core.HandlerRefnull—
calendar_icon_asset?svg_assets.Assetnull—
prev_icon_asset?svg_assets.Assetnull—
next_icon_asset?svg_assets.Assetnull—
test_id?[]const u8null—
DateRangePickerResult
ui.widgets.DateRangePickerField
Type
Default
Description
wrapper*Node—
—
state*DateRangePickerState—
—