TimeField

A segmented time input field. Each part (hour, minute, second) is an individually editable segment.

Example

Time
0230PM

Value: 14:30

Root Props

PropTypeDefaultDescription
valueTimeValueCurrent time value, bindable
onValueChange(value) => voidCalled when value changes
placeholderTimeValuePlaceholder time, bindable
minValueTimeValueMinimum allowed time
maxValueTimeValueMaximum allowed time
disabledbooleanfalseDisable the field
readonlybooleanfalseMake the field read-only
localestring'en'Locale for segment formatting
granularity'hour' | 'minute' | 'second'Finest unit to display
hourCycle12 | 2412 or 24-hour time format
hideTimeZonebooleanfalseHide time zone segment
requiredbooleanfalseMark as required

Sub-components

ComponentKey PropsDescription
TimeField.LabelclassLabel for the field
TimeField.Inputname, classContainer that auto-renders time segments
TimeField.Segmentpart, classIndividual editable time segment

Usage

<script>
  import { TimeField } from '@chrissnell/chonky-ui';
  import { Time } from '@internationalized/date';

  let value = $state(new Time(14, 30));
</script>

<TimeField.Root bind:value>
  <TimeField.Label>Time</TimeField.Label>
  <TimeField.Input />
</TimeField.Root>