Reference

DateRangePicker

A first and a last day, chosen in two months side by side that a button opens, or by a preset: presets: [.last7, .thisMonth]. bind: holds { start, end }.

DateRangePicker(bind: State, label: String, min: Date, …)

Since 6.2.0

label

Nov 1, 2026 to Nov 17, 2026

Example

wf

state period = { start: @2026-11-01, end: @2026-11-17 } DateRangePicker(bind: period, label: "Report period", presets: [.today, .last7, .last30, .thisMonth, .lastMonth]) Text("{period.start:.date(medium)} to {period.end:.date(medium)}").muted

Held between two dates

wf

state stay = { start: @2026-12-20, end: @2026-12-27 } DateRangePicker(bind: stay, label: "Stay", min: @2026-11-17, max: @2027-11-17)

Props

Props of DateRangePicker
PropTypeUnsetMeaning

bind:

State (required)

—

The state it reads and writes: a { start, end } of Dates, end null until the second day; the panel closes once both are chosen

label:

String (required)

—

What the range is: the button's words (Stay: 3 Mar 2026 – 9 Mar 2026 once chosen) and the panel's name

min:

Date

none

The first day that can be chosen in either month

max:

Date

none

The last day that can be chosen in either month

presets:

[RangePreset]

none

Buttons above the months, each a range a press takes: .today, .last7, .last30, .thisMonth, .lastMonth, in the order listed

Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.

Flags and cases

A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.

No flags of its own.

Events

Every element also takes the props, the events and the attribute families listed on every element.

Slots

It takes no slots.

Renders with the class wf-date-range, stable across releases, so a stylesheet may target it.