DateField

A segmented date input field. Each part of the date (month, day, year) is an individually editable segment.

Example

Date
04032026

Value: 2026-04-03

Root Props

PropTypeDefaultDescription
valueDateValueCurrent date value, bindable
onValueChange(value) => voidCalled when value changes
placeholderDateValuePlaceholder date, bindable
minValueDateValueMinimum allowed date
maxValueDateValueMaximum allowed date
disabledbooleanfalseDisable the field
readonlybooleanfalseMake the field read-only
localestring'en'Locale for segment formatting
granularity'day' | 'month' | 'year' | 'hour' | 'minute' | 'second'Finest unit to display
hourCycle12 | 2412 or 24-hour time format
hideTimeZonebooleanfalseHide time zone segment
requiredbooleanfalseMark as required for forms

Sub-components

ComponentKey PropsDescription
DateField.LabelclassLabel associated with the field
DateField.Inputname, classContainer that auto-renders date segments
DateField.Segmentpart, classIndividual editable date segment (used internally by Input)

Usage

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

  let value = $state(new CalendarDate(2026, 4, 3));
</script>

<DateField.Root bind:value>
  <DateField.Label>Date</DateField.Label>
  <DateField.Input />
</DateField.Root>