Reference

Calendar

A month as a grid of days, chosen with a press or the keyboard — the arrows by day and week, PageUp and PageDown by month, Home and End to the week's ends — one day, a range, or several. bind: holds a Date, a { start, end } with .range, a list with .multiple.

Calendar(bind: State, mode: Enum, min: Date, …)

Since 6.2.0

mode

single

range

multiple

label

Delivered on November 17, 2026

Example

wf

state delivery: Date? = @2026-11-17 Calendar(bind: delivery, min: @2026-11-17, disabled: d => d.weekday() >= 6, label: "Delivery day").single if let d = delivery { Text("Delivered on {d:.date(long)}").muted }

A range

wf

state stay = { start: @2026-12-20, end: @2026-12-27 } Calendar(bind: stay, mode: .range, label: "Your stay") Text("{stay.start:.date(medium)} to {stay.end:.date(medium)}")

Several days

wf

state days: [Date] = [@2026-11-18, @2026-11-20] Calendar(bind: days, mode: .multiple, label: "Days you can attend") Text("{days.length} day(s) chosen")

Props

Props of Calendar
PropTypeUnsetMeaning

bind:

State (required)

—

The state it reads and writes, by mode:: a Date?, a { start, end } of Dates (end null until the second day), or a [Date] kept in order

mode:

one of its cases

single

How many days it holds. Written as a flag, .single, or by name, mode: .single.

  • .single (the default): One day: bind: is a Date
  • .range: A first and a last day: { start, end }; a third press starts again
  • .multiple: Any number of days: a list, a press adding or removing one

min:

Date

none

The first day that can be chosen; days before it are shown but cannot be chosen

max:

Date

none

The last day that can be chosen; days after it are shown but cannot be chosen

disabled:

[Date] or (Date) -> Bool

none

Days that cannot be chosen: a list of them, or a test of a day, d => d.weekday() >= 6

label:

String

Calendar

Its name for a screen reader, read once when it is drawn

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.

.single

.range

.multiple

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-calendar, stable across releases, so a stylesheet may target it.