Basic Usage
Reading the Value
Use.rx to get a reactive reference to the selected date. The value is an ISO date string once a date is picked, but starts as undefined when nothing is selected. Use .then() to handle both states — showing formatted text when a date exists, and fallback text otherwise:
Before a date is picked, the text shows “None yet”. Pick a date and it updates instantly — the .date("long") pipe formats an ISO string like "2026-04-02" into "April 2, 2026".
In a Form
DatePicker works naturally alongside other form controls. Each component’s value syncs to state automatically — use.rx to reference it elsewhere:
API Reference
DatePicker Parameters
Button text when no date is selected.
State key for the selected date (stored as an ISO string).
Action(s) triggered when the date changes.
Additional Tailwind CSS classes.
Protocol Reference
DatePicker