Skip to content

Time Field

STimeField is a segmented time input: separate editable parts (hours, minutes, and seconds and AM/PM when needed). It works from the keyboard (arrow keys increment), is localized and respects the 12/24-hour format. The value is a Time (or CalendarDateTime/ZonedDateTime) from @internationalized/date; it is built on SFormField. The time counterpart of SDateField. Keep the value in a shallowRef, not a ref: a regular ref unwraps the date class, and type checking no longer recognizes it as a DateValue.

Basic usage

12-hour format and seconds

Hint and error

hint shows helper text below the field, error shows an error message and marks the field invalid.

States

disabled blocks the field, readonly prevents changing the segments, invalid marks the field invalid (red border), required adds * to the label.

Sizes

The size prop controls the field height: sm (28px), md (36px, default) and lg (44px).

prepend / append slots

The prepend and append slots put content inside the field border — for example, a clock icon.

Leaving the field

The field has focus and blur events, like SInput. Moving between segments does not count as leaving — see the details and a validation example on the SDatePicker page.

API

Props

NameTypeDefaultDescription
idstringundefinedField id. Generated automatically when not set (SSR-safe).
labelstringundefinedField label.
floating-labelbooleantrueFloating label: the label sits inside the border, looks like a placeholder at rest and floats up to the top edge on focus or when filled. On by default; false renders a regular label above the field. The label size is fixed and does not depend on size.
hintstringundefinedHint below the field.
errorstringundefinedError message. When set, the field is marked invalid.
size"md" | "sm" | "lg""md"Field size: sm (32px), md (40px) or lg (48px).
disabledbooleanfalseDisables input and makes the field inactive.
readonlybooleanfalseRead-only: the segments cannot be changed.
requiredbooleanfalseMarks the field as required: adds * to the label.
invalidbooleanfalseExplicitly marks the field invalid (in addition to error).
squarebooleanundefinedSquare corners: removes the field border radius (rounded by default).
localestringundefinedFormatting locale (for example en-GB). Derived from the library locale by default (ConfigProvider/installLocale, in Nuxt the locale option): enen-US.
hour-cycle12 | 24undefinedHour cycle: 12- or 24-hour. Defaults to the locale's preference.
granularity"hour" | "minute" | "second"undefinedGranularity: the smallest segment to display (hour/minute/second).
min-value | CalendarDateTime | ZonedDateTime | TimeundefinedMinimum allowed time.
max-value | CalendarDateTime | ZonedDateTime | TimeundefinedMaximum allowed time.
model-value | CalendarDateTime | ZonedDateTime | TimeundefinedTime value (Time/CalendarDateTime/ZonedDateTime). Two-way bound via v-model.

Events

NameSignatureDescription
update:modelValue( value: | Time | CalendarDateTime | ZonedDateTime | undefined ) => voidEmitted when modelValue changes. Used for two-way binding (v-model).
focus(event: FocusEvent) => voidFocus entered the field. Moving between segments does not count.
blur(event: FocusEvent) => voidFocus left the field. Moving between segments does not count.

Slots

NameDescription
prependContent at the start of the field, inside the border (icon, button).
appendContent at the end of the field, inside the border (icon, button).