Vue Time Picker Component API

Time Picker API

CoreUI PRO
This component is part of CoreUI PRO – a powerful UI library with over 250 components and 25+ templates, designed to help you build modern, responsive apps faster. Fully compatible with Angular, Bootstrap, React.js, and Vue.js.

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

On this page

CTimePicker

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

Props

PropertyDefaultType
ariaCleanerLabel'Clear time'string

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

ariaDayLabel'Day'string

The aria-label of the day section.

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.

ariaPickerLabel6.0.0+'Toggle time selection'string

Sets the accessible label (aria-label) of the button that opens the time selection.

ariaPopupLabel6.0.0+'Time selection'string

Sets the accessible label (aria-label) of the time selection 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.

ariaSelectHoursLabel'Select hours'string

Sets the accessible label of the hours column.

ariaSelectMeridiemLabel'Select AM/PM'string

Sets the accessible label of the AM/PM column.

ariaSelectMinutesLabel'Select minutes'string

Sets the accessible label of the minutes column.

ariaSelectSecondsLabel'Select seconds'string

Sets the accessible label of the seconds column.

ariaWeekLabel'Week'string

The aria-label of the week section.

ariaYearLabel'Year'string

The aria-label of the year section.

cleanertrueboolean

Renders the button that clears the value.

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

The element the time selection 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.

dayPlaceholder-string

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

disabled-boolean

Toggles the disabled state.

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.

floatingLabel6.0.0+-string

Renders a floating label inside the field — the component wraps its input in .form-floating and the text also becomes the field's accessible name.

floatingLabelAlways6.0.0+-boolean

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

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. The mask's hour cycle also drives the columns.

hourPlaceholder-string

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

hoursundefinednumber[], ((hour: number) => boolean)

Narrows the hours to a list, or to the ones a predicate accepts. Hours are 0 to 23 in every locale; on a 12-hour clock an hour that only one day period allows sets that period when picked.

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.

maxDate6.0.0+-

The latest time the user can pick: a time string such as '17:00', or a Date of which only the time of day counts. The panel disables the times after it, a time picked in the panel moves back to it, and the field rejects a later time.

meridiemPlaceholder-string

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

minDate6.0.0+-

The earliest time the user can pick: a time string such as '09:30', or a Date of which only the time of day counts. The panel disables the times before it, a time picked in the panel moves up to it, and the field rejects an earlier time.

minutePlaceholder-string

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

minutestrueboolean, number[], ((minute: number) => boolean)

Renders the minutes column, optionally narrowed the way hours is.

monthPlaceholder-string

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

name-string

Name of the value input the value is submitted under. Without it the field is not submitted with the form.

pickerIcontrueboolean

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

portaltrueboolean

Renders the time selection 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.

secondstrueboolean, number[], ((second: number) => boolean)

Renders the seconds column, optionally narrowed the way hours is.

show6.0.0+undefinedboolean

Control the open state via v-model:show. When set, the time selection renders what show says and dismiss gestures only emit update:show.

sizeundefinedstring

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

text-string

Add helper text to the component.

timeundefinedDate, string, null

The time — a Date or a time string like '14:30'. Passed one-way it seeds the field, which keeps managing itself; bound with v-model:time it follows your state.

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 every section of the field and blocks the submit. Any custom state declared in the $form-validation-states Sass map is accepted. The user's next change of the time emits update:validationState with undefined.

visibleDeprecated 6.0.0undefinedboolean

Controls the visibility of the time selection.

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

weekPlaceholder-string

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

yearPlaceholder-string

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

Events

Event name
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 time-change, so a value set from it replaces the one just reported.

hide

Callback fired when the time selection is hidden.

show

Callback fired when the time selection is shown.

time-change

Callback fired once when the value changes, whether from the field, the panel or the context methods; receives the Date the field holds, anchored to 1970-01-01 and cut to the units the field shows, or null while the field is empty or incomplete, and the formatted value.

  • time Date | null — date object
  • formattedTime string — formatted time
update:show

Emit the requested open state to support the v-model:show binding.

update:time

Emit the new time to support the v-model:time binding.

  • time Date | null — date object
update:validationState

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