Date Picker

Single day and range calendars in a popover, with locale-aware month titles and week start.

Also known as: calendar, date range, range picker

Installation

Install with the CLI, or copy the component source into your project.

Add date-picker (npm)

npx --yes -p github:itsvigneshv/default-file-ui#main df-ui add date-picker

Properties

Single-day DatePicker and range DateRangePicker. Both open a locale-aware calendar in a popover.

Shared props

Available on DatePicker and DateRangePicker.

PropTypeDefaultNotes
localestring"en-US"BCP 47 locale for the month title and the first day of the week.
minstring | null-Earliest selectable ISO day.
maxstring | null-Latest selectable ISO day.
disabledDates(dayIso: string) => boolean-Return true to disable a specific day.
placeholderstring-Trigger field placeholder when empty.
openboolean-Controlled open state for the calendar popover.
defaultOpenboolean-Uncontrolled initial open state.
onOpenChange(open: boolean) => void-Called when the popover open state changes.
disabledboolean-Disable the trigger and calendar.
idstring-Id forwarded to the trigger input.
aria-labelstring-Accessible name for the trigger when no external label is used.
classNamestring-Additional styles on the root.

DatePicker

PropTypeDefaultNotes
valuestring | null-Controlled ISO day value.
defaultValuestring | null-Uncontrolled initial ISO day.
onChange(value: string | null) => void-Called when the selected day changes.

DateRangePicker

PropTypeDefaultNotes
valueDateRangeValue | null-Controlled { start, end } ISO day range.
defaultValueDateRangeValue | null-Uncontrolled initial range.
onChange(value: DateRangeValue | null) => void-Called when the range changes.