The Calendar component renders a month view for selecting dates. It supports single date, multiple date, and date range selection. Selected dates are stored in client state as ISO strings.Documentation Index
Fetch the complete documentation index at: https://prefab.prefect.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
Basic Usage
Initial Value
Pass adatetime.date to value to pre-select a date:
Range Selection
Setmode="range" to let users select a start and end date. The value is a dict with "from" and "to" keys:
Multiple Selection
Select multiple individual dates withmode="multiple". The value is a list of dates:
Reading the Value
Use.rx to get a reactive reference to the calendar’s current selection. What .rx holds depends on the mode: an ISO date string for single mode, a {"from": ..., "to": ...} object for range mode, or an array of ISO strings for multiple mode. The .date() pipe formats a single ISO string for display:
Click a date and the input updates instantly. The .date("long") pipe formats an ISO string like "2025-01-15" into "January 15, 2025".
API Reference
Calendar Parameters
Selection mode:
"single", "multiple", or "range".Initial selected date(s). Single: a
datetime.date. Range: {"from": date, "to": date}. Multiple: a list of dates. Any position also accepts an Rx for reactive binding.State key for storing the selected date. Single mode stores an ISO string; range mode stores
{"from": "...", "to": "..."}.Action(s) triggered when the selection changes.
Additional Tailwind CSS classes.
Protocol Reference
Calendar