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
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
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
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
| Prop | Type | Unset | Meaning |
|---|---|---|---|
bind: | State (required) | — | The state it reads and writes, by |
mode: | one of its cases | single | How many days it holds. Written as a flag,
|
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, |
label: | String |
| 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.