Calendar
Calendar is a themeable, accessible date picker component powered by Pikaday and styled with DaisyUI. It supports custom skeleton loading, flexible options, and v-model integration.
Calendar is a themeable, accessible date picker component powered by Pikaday and styled with DaisyUI. It supports custom skeleton loading, flexible options, and v-model integration.
The Calendar components include the following:
The Calendar component is a themeable, accessible date picker powered by Pikaday and styled with DaisyUI.
It supports v-model, custom options, and auto-default behaviors.
| Calendar Props | Type | Description |
|---|---|---|
modelValue | Date | string | null | |
options | Partial<PikadayOptions> | Additional Pikaday options (except |
| Â Â Â ariaLabel | string | Sets aria-label for accessibility (applies when bound is set). |
| Â Â Â format | string | Output format for .toString() and field value (default: 'D MMM YYYY'). |
| Â Â Â formatStrict | boolean | Use strict date parsing (requires Moment.js for custom formatting). |
| Â Â Â toString | function | Custom function for formatting the date string. |
| Â Â Â parse | function | Custom function for parsing input string to a date. |
| Â Â Â defaultDate | Date | Initial date to view when first opened. |
| Â Â Â setDefaultDate | boolean | Make the defaultDate the initial selected value. |
| Â Â Â firstDay | number | First day of the week (0: Sunday, 1: Monday, etc). |
| Â Â Â minDate | Date | Minimum/earliest selectable date. |
| Â Â Â maxDate | Date | Maximum/latest selectable date. |
| Â Â Â disableWeekends | boolean | Disallow selection of Saturdays or Sundays. |
| Â Â Â disableDayFn | function | Callback to disable selection for specific days. |
| Â Â Â yearRange | number | [number, number] | Years before/after or explicit min, max year range. |
| Â Â Â showWeekNumber | boolean | Show ISO week number at the head of the row. |
| Â Â Â pickWholeWeek | boolean | Select a whole week instead of a day. |
| Â Â Â isRTL | boolean | Reverse the calendar for right-to-left languages. |
| Â Â Â i18n | object | Language defaults for month and weekday names. |
| Â Â Â yearSuffix | string | Additional text to append to the year in the title. |
| Â Â Â showMonthAfterYear | boolean | Render the month after year in the title. |
| Â Â Â showDaysInNextAndPreviousMonths | boolean | Render days from next/previous months in the calendar grid. |
| Â Â Â enableSelectionDaysInNextAndPreviousMonths | boolean | Allow selection of days in next/previous months. |
| Â Â Â numberOfMonths | number | Number of visible calendars. |
| Â Â Â events | array | Array of dates to highlight as events. |
autoDefault | boolean | If true, defaults to today when no value is provided. |
| Calendar Events | Arguments | Description |
|---|---|---|
update:modelValue | ||
update:inputValue | Emitted when the formatted input value changes. |
| Calendar Slots | Description |
|---|---|
default | The default slot for custom input rendering (not commonly used). |
The CalendarInput component provides a classic input-based date picker using Pikaday and styled with DaisyUI input classes. It is fully compatible with all DaisyUI input props (color, size, validation, etc.), supports v-model, and is focus-stealing safe.
The input always displays a formatted date string and opens a dropdown calendar on focus. It is suitable for forms and scenarios where users expect to type or pick a date from a calendar overlay.
| CalendarInput Props | Type | Description |
|---|---|---|
modelValue | Date | string | number | null | |
options | Partial<PikadayOptions> | Additional Pikaday options (except |
| Â Â Â bound | boolean | Automatically show/hide the datepicker on field focus (default: true). |
| Â Â Â position | string | Preferred position of the datepicker relative to the field (e.g. 'bottom left'). |
| Â Â Â reposition | boolean | Reposition datepicker within the viewport (default: true). |
autoDefault | boolean | If true, defaults to today when no value is provided. |
placeholder | string | Input placeholder text. |
disabled | boolean | Disables the input. |
validator | boolean | Enables validation styling. |
join | boolean | Enables DaisyUI join-item styling. |
color | string | DaisyUI color (primary, secondary, accent, etc.). |
| Â Â Â primary | boolean | Applies primary color styling. |
| Â Â Â secondary | boolean | Applies secondary color styling. |
| Â Â Â accent | boolean | Applies accent color styling. |
| Â Â Â info | boolean | Applies info color styling. |
| Â Â Â success | boolean | Applies success color styling. |
| Â Â Â warning | boolean | Applies warning color styling. |
| Â Â Â error | boolean | Applies error color styling. |
ghost | boolean | Applies ghost input styling. |
size | 'xl' | 'lg' | 'md' | 'sm' | 'xs'
| DaisyUI input size. |
| Â Â Â xl | boolean | Shortcut for size="xl". |
| Â Â Â lg | boolean | Shortcut for size="lg". |
| Â Â Â md | boolean | Shortcut for size="md". |
| Â Â Â sm | boolean | Shortcut for size="sm". |
| Â Â Â xs | boolean | Shortcut for size="xs". |
| CalendarInput Events | Arguments | Description |
|---|---|---|
update:modelValue | ||
update:inputValue | Emitted when the formatted input value changes. |
The CalendarSkeleton component displays a loading placeholder styled to match the Calendar layout, including support for multiple stacked months. Use it to indicate loading states for the Calendar component and avoid layout shift.
| CalendarSkeleton Props | Type | Description |
|---|---|---|
numberOfMonths | number | Number of months to display in the skeleton (default: 1). Set to match the |
Restrict the selectable date range to between today and one month from now.
Prevent users from selecting Saturdays or Sundays.
Limit the year picker to between 1990 and 2030.
Show two months vertically for more visibility.
Display and parse dates in ISO format (YYYY-MM-DD).
To implement a custom display format, provide a toString function in the Pikaday options. This function receives the selected date and the format string as arguments. You can use a plain JavaScript function to format the date as needed, as shown in the example below.
Highlight special dates on the calendar.
Note: Event dates must be output as .toDateString() strings (e.g., 'Sat Jun 28 2017') for the calendar to highlight them correctly.
Display the calendar in right-to-left mode for RTL languages.
Set Monday as the first day of the week.
Use CalendarInput for a classic input-based date picker with a dropdown calendar.
Restrict the input-based picker to a date range.
The CalendarSkeleton is a special Skeleton component that matches the Calendar layout, including support for multiple stacked months.