Vue Date Range Picker Component API

Date Range Picker API

Explore the API reference for the Vue Date Range Picker component and discover how to effectively utilize its props for customization.

On this page

CDateRangePicker

jsx
import { CDateRangePicker } from '@coreui/vue-pro'

Props

PropertyDefaultType
ariaCleanerLabel'Clear date range'string

Sets the accessible label (aria-label) of the button that clears the value.

ariaDayLabel'Day'string

The aria-label of the day section.

ariaEndLabel6.0.0+'End date'string

The accessible name of the end field, used when it has no floating label.

ariaHourLabel'Hour'string

The aria-label of the hour section.

ariaMeridiemLabel'AM/PM'string

The aria-label of the meridiem section.

ariaMinuteLabel'Minute'string

The aria-label of the minute section.

ariaMonthLabel'Month'string

The aria-label of the month section.

ariaNavNextMonthLabel'Next month'string

A string that provides an accessible label for the button that navigates to the next month in the calendar.

ariaNavNextYearLabel'Next year'string

A string that provides an accessible label for the button that navigates to the next year in the calendar.

ariaNavNextYearsLabel6.0.0+'Next 12 years'string

Sets the accessible label (aria-label) of the button that turns the years view to the next page of years.

ariaNavPrevMonthLabel'Previous month'string

A string that provides an accessible label for the button that navigates to the previous month in the calendar.

ariaNavPrevYearLabel'Previous year'string

A string that provides an accessible label for the button that navigates to the previous year in the calendar.

ariaNavPrevYearsLabel6.0.0+'Previous 12 years'string

Sets the accessible label (aria-label) of the button that turns the years view to the previous page of years.

ariaNothingToPickLabel6.0.0+'Nothing on this page can be picked'string

Sets the description (aria-describedby) of a grid in which nothing can be picked, such as a page wholly outside minDate / maxDate or one that disabledDates covers, also announced when the calendar turns to such a page. An empty string leaves the grid without a description.

ariaPickerLabel6.0.0+'Toggle calendar'string

Sets the accessible label (aria-label) of the button that opens the calendar, followed by the range the picker holds.

ariaPopupLabel6.0.0+'Calendar'string

Sets the accessible label (aria-label) of the calendar panel, which opens as a role="dialog".

ariaQuarterLabel'Quarter'string

The aria-label of the quarter section.

ariaSecondLabel'Second'string

The aria-label of the second section.

ariaSelectedDateAnnouncement6.0.0+'Selected date: {date}'string

Sets the message announced when a pick leaves both ends on the same day, unless the pick closes the panel, which names the toggle with the range instead. {date} is replaced by the full name of that day, week, month, quarter or year. An empty string announces nothing.

ariaSelectedRangeAnnouncement6.0.0+'Selected range: {start} to {end}'string

Sets the message announced when a pick leaves both ends set, unless the pick closes the panel, which names the toggle with the range instead. {start} and {end} are replaced by the full names of its ends. An empty string announces nothing.

ariaStartLabel6.0.0+'Start date'string

The accessible name of the start field, used when it has no floating label.

ariaWeekLabel'Week'string

The aria-label of the week section.

ariaWeekNumberLabel6.0.0+-(weekNumber: number) => string, undefined

Names each week number for screen readers: a function that takes the week number and returns its name. Without it the name is the locale's word for week and the number, such as Week 36. Keep the number in the name, so a voice-control user can say what they see.

ariaYearLabel'Year'string

The aria-label of the year section.

calendarDateundefinedDate, string, null

The date the calendar opens on while nothing is selected.

calendars2number

The number of calendars shown side by side.

cleanertrueboolean

Renders the button that clears the value.

container'body'HTMLElement, (() => HTMLElement), string

The element the calendar is rendered into instead of document.body. Implies portal. Inside a modal dialog it goes into the dialog instead, because the rest of the page is inert.

dayFormat'numeric'func, string

Set the format of day name.

dayPlaceholder-string

Replaces the DD the day section shows while it is empty.

disabled-boolean

Toggles the disabled state.

disabledDatesundefinedDisabledDate, DisabledDate[]

Specify the list of dates that cannot be selected. It can be a single Date, an [start, end] range, a matcher function, or an array of these. In week, month, quarter and year selection a period is disabled when every day of it is.

endDateundefinedDate, string, null

The end of the range. Passed one-way it seeds the range, which keeps managing itself; bound with v-model:end-date it follows your state.

endName-string

Name of the end value input. Without it the end date is not submitted with the form.

feedback-string

Provide valuable, actionable feedback to your users with HTML5 form validation feedback.

feedbackInvalid-string

Provide valuable, actionable invalid feedback when using standard HTML form validation which applied invalid prop.

feedbackValid-string

Provide valuable, actionable valid feedback when using standard HTML form validation which applied valid prop.

firstDayOfWeek1number

Sets the day of start week. - 0 - Sunday, - 1 - Monday, - 2 - Tuesday, - 3 - Wednesday, - 4 - Thursday, - 5 - Friday, - 6 - Saturday,

floatingLabelAlways6.0.0+-boolean

Keeps the floating label floated and the placeholder visible while the field is empty.

floatingLabels6.0.0+-string[]

Renders a floating label over each field — ['Check-in', 'Check-out'] — which also becomes that field's accessible name.

formatundefinedstring, ((locale: string) => DateSection[])

The mask layout of the field. A string is parsed as dayjs/moment or date-fns/luxon format tokens, a function receives the locale and returns the section layout, and undefined derives the layout from the locale and the selection type.

hourPlaceholder-string

Replaces the HH (hh on a 12-hour clock) the hour section shows while it is empty.

inputDateParseundefined(value: string) => Date, null

Custom function to parse text pasted into the field into a Date object, e.g. with an external date library.

invalidDeprecated 6.0.0-boolean

Mark the control invalid.

Use validationState="invalid" instead — invalid is ignored when validationState is set.

label-string

Add a caption for a component.

locale'default'string

Sets the default locale for the component. If not set, it is inherited from the browser.

maxDateundefinedDate, string, null

Max selectable date. The days after its day are disabled, and a time of day it carries leaves its own day selectable. In week selection its whole week stays selectable.

meridiemPlaceholder-string

Replaces the AM the meridiem section shows while it is empty.

minDateundefinedDate, string, null

Min selectable date. The days before its day are disabled, and a time of day it carries leaves its own day selectable. In week selection its whole week stays selectable.

minutePlaceholder-string

Replaces the mm the minute section shows while it is empty.

monthFormat'short'string

Sets the format for month names.

monthNamesundefinedstring[]

Twelve custom month names for text month sections (MMM/MMMM), overriding the locale-derived, date-context grammatical form.

monthPlaceholder-string

Replaces the MM the month section shows while it is empty.

pickerIcontrueboolean

The button that opens the panel. Set to false to render no button; replace the artwork through the pickerIcon slot.

portaltrueboolean

Renders the calendar through a portal: into the open <dialog> the field sits in, otherwise into document.body.

quarterPlaceholder-string

Replaces the Q the quarter section shows while it is empty.

readOnly-boolean

Toggle the readonly state for the component.

required-boolean

When present, it specifies that the field must be filled out before submitting the form.

secondPlaceholder-string

Replaces the ss the second section shows while it is empty.

selectAdjacentDays-boolean

Set whether days in adjacent months shown before or after the current month are selectable. This only applies if the showAdjacentDays option is set to true. A picked day of an adjacent month keeps the month on screen and shows as selected with an outline on a subtle background instead of the solid fill.

selectionType'day'string

Specify the type of date selection as day, week, month, quarter, or year.

show6.0.0+undefinedboolean

Control the open state via v-model:show. When set, the calendar renders what show says and dismiss gestures only emit update:show — nothing closes until the parent flips the prop.

showAdjacentDaystrueboolean

Set whether to display dates in adjacent months (non-selectable) at the start and end of the current month.

showWeekNumber-boolean

Set whether to display week numbers in the calendar.

sizeundefinedstring

Sizes the control, the way .form-control-sm and .form-control-lg size a form control.

startDateundefinedDate, string, null

The start of the range. Passed one-way it seeds the range, which keeps managing itself; bound with v-model:start-date it follows your state.

startName-string

Name of the start value input. Without it the start date is not submitted with the form.

text-string

Add helper text to the component.

tooltipFeedback-boolean

Display validation feedback in a styled tooltip.

validDeprecated 6.0.0-boolean

Mark the control valid.

Use validationState="valid" instead — valid is ignored when validationState is set.

validationState6.0.0+-string

The validation state, rendered as the is-{state} class; 'invalid' also sets aria-invalid on the sections of both fields and blocks the submit. Any custom state declared in the $form-validation-states Sass map is accepted. The user's next change of the range emits update:validationState with undefined.

visibleDeprecated 6.0.0undefinedboolean

Controls the visibility of the calendar.

Use show / v-model:show instead — visible is ignored when show is set.

weekdayFormat2func, number, string

Set length or format of day name.

weekNumbersLabel-string

Label displayed over week numbers in the calendar. Without it the column is named for screen readers with the locale's word for week.

weekPlaceholder-string

Replaces the WW the week section shows while it is empty.

yearFormat'numeric'string

Sets how the year cells of the years view write the year: 'numeric' (2026) or '2-digit' (26). The navigation always writes the full year.

yearPlaceholder-string

Replaces the YYYY the year section shows while it is empty.

Events

Event name
calendar-date-change

Callback fired when the calendar date changed.

  • date Date | null
  • view ViewTypes
end-date-change

Callback fired once when the end of the range changes, whether from its field, the calendar or the context methods; receives the Date the field holds (or null while it is empty, incomplete or out of range) and the formatted value.

  • date Date | null — date object
  • formattedDate string — formatted date
error

Callback fired when the validation state changes; receives 'incomplete', 'minDate', 'maxDate', 'disabledDate', or null when the value is valid or the field is empty. When one change moves both the value and the validation state, it fires after start-date-change and end-date-change, so a value set from it replaces the one just reported.

hide

Callback fired when the calendar is hidden.

show

Callback fired when the calendar is shown.

start-date-change

Callback fired once when the start of the range changes, whether from its field, the calendar or the context methods; receives the Date the field holds (or null while it is empty, incomplete or out of range) and the formatted value.

  • date Date | null — date object
  • formattedDate string — formatted date
update:end-date

Emit the new end of the range to support the v-model:end-date binding.

  • date Date | null — date object
update:show

Emit the requested open state to support the v-model:show binding — a dismiss gesture (Escape, a click outside) or any internal toggle.

update:start-date

Emit the new start of the range to support the v-model:start-date binding.

  • date Date | null — date object
update:validationState

Event occurs with undefined when the user changes either end, or the form is reset, while validationState (or the deprecated invalid/valid) is set. A given state is a verdict on the range it was given for; bind it with v-model:validation-state to drop it and let the browser's own validation show again.

view-change

Callback fired when the calendar's view changes between days, months, quarters or years, and with the starting view each time the calendar opens.

  • view ViewTypes