Skip to content

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 ​

PropTypeDefaultDescription
size'sm' | 'md' | 'lg''md'Control scale
placeholderstring'Pick a date'Shown while nothing is selected
disabledboolean—Trigger cannot be opened
invalidboolean—Red border and ring; inherited from IFormField when unset
idstring—Id for the trigger; IFormField supplies one
minstring—Earliest selectable date, ISO YYYY-MM-DD
maxstring—Latest selectable date, ISO YYYY-MM-DD
localestring—Month names, weekday initials and trigger text
formatIntl.DateTimeFormatOptions—How the selected date reads on the trigger
weekStartsOn0–6—0 is Sunday. Defaults to the locale's convention
clearableboolean—Adds a clear action to the footer
todayLabelstring'Today'Footer action label
clearLabelstring'Clear'Clear action label
previousLabelstring'Previous month'Accessible name for the back arrow
nextLabelstring'Next month'Accessible name for the forward arrow
unstyledboolean—Drop built-in classes
classstring—Applied to the trigger, which carries the field chrome
ui{ trigger?, placeholder?, content?, header?, heading?, nav?, months?, grid?, headCell?, cell?, cellTrigger?, footer?, action? }—Per-element class overrides

Model ​

ts
const issuedOn = ref<string | null>(null)

For a span rather than a single day, use IDateRangePicker.