Single day and range calendars in a popover, with locale-aware month titles and week start.
Also known as: calendar, date range, range picker
Install with the CLI, or copy the component source into your project.
Add date-picker (npm)
1npx --yes -p github:itsvigneshv/default-file-ui#main df-ui add date-picker
Single-day DatePicker and range DateRangePicker. Both open a locale-aware calendar in a popover.
Available on DatePicker and DateRangePicker.
| Prop | Type | Default | Notes |
|---|---|---|---|
| locale | string | "en-US" | BCP 47 locale for the month title and the first day of the week. |
| min | string | null | - | Earliest selectable ISO day. |
| max | string | null | - | Latest selectable ISO day. |
| disabledDates | (dayIso: string) => boolean | - | Return true to disable a specific day. |
| placeholder | string | - | Trigger field placeholder when empty. |
| open | boolean | - | Controlled open state for the calendar popover. |
| defaultOpen | boolean | - | Uncontrolled initial open state. |
| onOpenChange | (open: boolean) => void | - | Called when the popover open state changes. |
| disabled | boolean | - | Disable the trigger and calendar. |
| id | string | - | Id forwarded to the trigger input. |
| aria-label | string | - | Accessible name for the trigger when no external label is used. |
| className | string | - | Additional styles on the root. |
| Prop | Type | Default | Notes |
|---|---|---|---|
| value | string | null | - | Controlled ISO day value. |
| defaultValue | string | null | - | Uncontrolled initial ISO day. |
| onChange | (value: string | null) => void | - | Called when the selected day changes. |
| Prop | Type | Default | Notes |
|---|---|---|---|
| value | DateRangeValue | null | - | Controlled { start, end } ISO day range. |
| defaultValue | DateRangeValue | null | - | Uncontrolled initial range. |
| onChange | (value: DateRangeValue | null) => void | - | Called when the range changes. |