Skip to content

Function: dateField()

ts
function dateField(props: UiDateFieldProps): Element;

Defined in: src/UI/blocks/dateField.tsx:69

Date field component for date input.

Parameters

ParameterTypeDescription
propsUiDateFieldPropsConfiguration object

Returns

Element

Examples

Basic usage with required props

dateField({
  name: 'birthDate',
  label: 'Birth Date',
  type: 'date'
});

Usage with default value

dateField({
  name: 'appointmentDate',
  label: 'Appointment Date',
  type: 'datetime-local',
  defaultValue: '2024-01-15T10:00',
  placeholder: 'Select appointment date and time',
  required: true,
  disabled: false
});

Usage with multiple date selection

dateField({
  name: 'availableDates',
  label: 'Available Dates',
  type: 'multiple',
  defaultValue: ['2024-01-15', '2024-01-16'],
  placeholder: 'Select multiple dates'
});

Usage with date range selection

dateField({
  name: 'vacationPeriod',
  label: 'Vacation Period',
  type: 'range',
  defaultValue: { from: '2024-01-15', to: '2024-01-20' },
  placeholder: 'Select date range'
});

Matterway Assistant SDK Documentation