Vivid API

Time Picker

Allows users to select a specific time using an input field and time picker interface.

Usage

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

Locales

By default, the Time Picker adapts to either 12-hour or 24-hour format based on the configured locale. Use the locale switcher in the example below to see this in action. Read more on localization in Vivid.

You can override this behavior using the clock attribute.

Slots

Helper-Text

The helper-text slot allows you to use rich content as the time-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
clock'12h' | '24h'Forces a 12h or 24h clock to be used.
disabledbooleanSets the element's disabled state. A disabled element will not be included during form submission.
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.
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.
maxstringSets the maximum time the user can set
minstringSets the minimum time the user can set
minutesStepnumberDistance between presented minute options.
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.
secondsStepnumberDistance between presented seconds options. If null, seconds are not presented.
value
(modelValue)
stringThe current value of the element.
PropertyTypeDefaultDescription
clock'12h' | '24h'Forces a 12h or 24h clock to be used.
disabledbooleanSets the element's disabled state. A disabled element will not be included during form submission.
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.
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.
maxstringSets the maximum time the user can set
minstringSets the minimum time the user can set
minutes-stepnumberDistance between presented minute options.
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.
seconds-stepnumberDistance between presented seconds options. If null, seconds are not presented.
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 time-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 time-picker. Alternative to the `helper-text` attribute.

Events

NameTypeDescription
changeCustomEvent<undefined>Emitted when the time is changed by the user.
inputCustomEvent<undefined>Emitted when the time is changed by the user.
NameTypeDescription
changeCustomEvent<undefined>Emitted when the time is changed by the user.
inputCustomEvent<undefined>Emitted when the time is changed by the user.

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.