Forms
IDatePicker
A calendar in a popover. The model is an ISO YYYY-MM-DD string, never a Date.
The string carries no time zone, so the date stays the day that was picked wherever it is read. Format it on the way out with Intl, dayjs or anything else.
With nothing selected the model is null and the trigger shows placeholder.
Bounds
min and max are ISO strings too. Dates outside the window are rendered disabled rather than hidden, so the reader can see where the limit falls.
Formatting the trigger
format takes Intl.DateTimeFormatOptions and decides how the selected date reads on the button. The calendar itself is unaffected.
Locale and week start
locale drives the month names, the weekday initials and the trigger's text. weekStartsOn overrides the locale's own convention when you need to — 0 is Sunday.
Every visible string is a prop: todayLabel, clearLabel, previousLabel and nextLabel.
Clearable
clearable adds a clear action beside "Today" in the footer. It sets the model back to null.
Sizes
Invalid and disabled
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | 'sm' | 'md' | 'lg' | 'md' | Control scale |
placeholder | string | 'Pick a date' | Shown while nothing is selected |
disabled | boolean | — | Trigger cannot be opened |
invalid | boolean | — | Red border and ring; inherited from IFormField when unset |
id | string | — | Id for the trigger; IFormField supplies one |
min | string | — | Earliest selectable date, ISO YYYY-MM-DD |
max | string | — | Latest selectable date, ISO YYYY-MM-DD |
locale | string | — | Month names, weekday initials and trigger text |
format | Intl.DateTimeFormatOptions | — | How the selected date reads on the trigger |
weekStartsOn | 0–6 | — | 0 is Sunday. Defaults to the locale's convention |
clearable | boolean | — | Adds a clear action to the footer |
todayLabel | string | 'Today' | Footer action label |
clearLabel | string | 'Clear' | Clear action label |
previousLabel | string | 'Previous month' | Accessible name for the back arrow |
nextLabel | string | 'Next month' | Accessible name for the forward arrow |
unstyled | boolean | — | Drop built-in classes |
class | string | — | Applied to the trigger, which carries the field chrome |
ui | { trigger?, placeholder?, content?, header?, heading?, nav?, months?, grid?, headCell?, cell?, cellTrigger?, footer?, action? } | — | Per-slot class overrides |
Model
const issuedOn = ref<string | null>(null)For a span rather than a single day, use IDateRangePicker.