Vivid API

Date Range Picker

Combines an Input and a dual Calendar popover to allow users to enter or select a date range.

Usage

import { VDateRangePicker } from '@vonage/vivid-api-vue';
import { registerDateRangePicker } from '@vonage/vivid-api';
registerDateRangePicker('your-prefix');

Locales

Dates will be stored in the format YYYY-MM-DD and displayed in the configured locale. Use the locale switcher in the example below to see this in action.

See Localization for more details.

Slots

Helper Text Slot

The helper-text slot allows you to use rich content as the date picker’s helper text.

Contextual Help

The contextual-help slot allows you to add the Contextual Help component next to the label.

API Reference

Properties

PropertyTypeDefaultDescription
disabledbooleanSets the element's disabled state. A disabled element will not be included during form submission.
currentEnd
(end)
stringThe current end value of the element. This property serves as a mechanism to set the `end` property through both property assignment and the .setAttribute() method. This is useful for setting the field's value in UI libraries that bind data through the .setAttribute() API and don't support IDL attribute binding.
errorTextstringProvides a custom error message. Any current error state will be overridden.
helperTextstringProvides additional information to help the user enter the correct information. To add HTML to the helper text, use the helper-text slot instead.
initialEndstringThe initial end value. This value sets the `end` property only when the `end` property has not been explicitly set.
initialStartstringThe initial start value. This value sets the `start` property only when the `start` property has not been explicitly set.
initialValuestringThe default value of the element. This value sets the `value` property only when the `value` property has not been explicitly set.
labelstringThe label for the form element.
maxstringThe latest accepted date.
minstringThe earliest accepted date.
namestringThe name of the element. This element's value will be surfaced during form submission under the provided name.
readOnlybooleanWhether the date-picker is readonly.
requiredbooleanRequire the field to be completed prior to form submission.
scale'condensed' | 'normal'Sets the display size of the picker field input element.
currentStart
(start)
stringThe current start value of the element. This property serves as a mechanism to set the `start` property through both property assignment and the .setAttribute() method. This is useful for setting the field's value in UI libraries that bind data through the .setAttribute() API and don't support IDL attribute binding.
valuestringThe current value of the element.
PropertyTypeDefaultDescription
disabledbooleanSets the element's disabled state. A disabled element will not be included during form submission.
current-endstringThe current end value of the element. This property serves as a mechanism to set the `end` property through both property assignment and the .setAttribute() method. This is useful for setting the field's value in UI libraries that bind data through the .setAttribute() API and don't support IDL attribute binding.
error-textstringProvides a custom error message. Any current error state will be overridden.
helper-textstringProvides additional information to help the user enter the correct information. To add HTML to the helper text, use the helper-text slot instead.
endstringThe initial end value. This value sets the `end` property only when the `end` property has not been explicitly set.
startstringThe initial start value. This value sets the `start` property only when the `start` property has not been explicitly set.
valuestringThe default value of the element. This value sets the `value` property only when the `value` property has not been explicitly set.
labelstringThe label for the form element.
maxstringThe latest accepted date.
minstringThe earliest accepted date.
namestringThe name of the element. This element's value will be surfaced during form submission under the provided name.
readonlybooleanWhether the date-picker is readonly.
requiredbooleanRequire the field to be completed prior to form submission.
scale'condensed' | 'normal'Sets the display size of the picker field input element.
current-startstringThe current start value of the element. This property serves as a mechanism to set the `start` property through both property assignment and the .setAttribute() method. This is useful for setting the field's value in UI libraries that bind data through the .setAttribute() API and don't support IDL attribute binding.
current-valuestringThe current value of the element.

Slots

NameDescription
contextual-helpSlot for the contextual-help component, displayed next to the label.
helper-textDescribes how to use the date-range-picker. Alternative to the `helper-text` attribute.
NameDescription
contextual-helpSlot for the contextual-help component, displayed next to the label.
helper-textDescribes how to use the date-range-picker. Alternative to the `helper-text` attribute.

Events

NameTypeDescription
changeCustomEvent<undefined>Emitted when either the start or end value changes
inputCustomEvent<undefined>Emitted when either the start or end value changes
input:endCustomEvent<undefined>Event emitted when the end value changes
input:startCustomEvent<undefined>Event emitted when the start value changes
NameTypeDescription
changeCustomEvent<undefined>Emitted when either the start or end value changes
inputCustomEvent<undefined>Emitted when either the start or end value changes
input:endCustomEvent<undefined>Event emitted when the end value changes
input:startCustomEvent<undefined>Event emitted when the start value changes

Methods

NameParamsReturnsDescription
checkValiditybooleanReturn the current validity of the element.
reportValiditybooleanReturn the current validity of the element. If false, fires an invalid event at the element.