Skip to main content
Neural UIv2.0.0Documentation
View v1 GitHub

DateInput

Choose dates and local times without turning a calendar value into a UTC instant.

Category
Forms and selection
Import
@neural-ui/core/date-input
Selector
neu-date-input
import { NeuDateInputControl } from '@neural-ui/core/date-input';

Choose a date

Use DateInput for a delivery date, appointment time or date range. Import the component and keep the value in a signal; no date adapter or icon package is required. Click anywhere in the field to open the picker, or use the chevron button.

A CivilDate describes a day on the calendar, not an instant. civilDate('2026-10-15') validates that value without adding a timezone. Keep it as a civil value when sending it to your application; convert to an instant only when your business rules explicitly supply a time and timezone.

Choose a date
Civil value: 2026-10-15

Configurator

Explore the seven value modes, overlay or inline presentation, size and calendar options. Changing mode resets the demo value to the matching public type; the generated template reflects your settings.

Configurator

Live preview

Generated template. The Code tab includes imports and state.

template.html
<neu-date-input
  [(value)]="value"
  (viewChange)="lastViewChange.set($event)"
  label="Delivery date"
  mode="date"
  presentation="overlay"
  size="md"
  [floatingLabel]="true"
  [firstDayOfWeek]="1"
  [showWeekNumbers]="false"
  [showMonthYearPicker]="true"
  [locale]="'en'"
/>

Modes and value types

Choose the mode for the value you need to store. date uses CivilDate (2026-10-15); time uses LocalTime (09:30); datetime uses LocalDateTime (2026-10-15T09:30). None represents a UTC instant.

Use multiple for independent days (readonly CivilDate[]). Use range for an interval (CivilDateRange with start and end); a partially selected range can have a null endpoint. month uses CivilMonth and year uses CivilYear when day precision is unnecessary. Each example below owns a separate, correctly typed value.

Modes and value types
"2026-10-15"
"09:30"
"2026-10-15T09:30"
[ "2026-10-15", "2026-10-20" ]
{ "start": "2026-10-15", "end": "2026-10-20" }
{ "year": 2026, "month": 10 }
{ "year": 2026 }

Limits and presentation

This delivery window allows October 10โ€“20, 2026, except October 17. min and max bound the civil date; disabledDates excludes a specific day. Try typing an out-of-range date and opening the calendar to compare both entry paths.

The switches explore disabled, readonly and inline presentation without exposing unrelated object APIs. Keep mode-specific values typed; changing a mode in a real form may require changing or clearing its model.

Limits and presentation

Civil value: 2026-10-15

Validation with Signal Forms

Bind FormField to a typed field. The schema supplies required validation, disabled and readonly state; you do not need a second value binding. Blur the empty field to display its error. Reset clears the value and form interaction state.

Use min, max and disabledDates for selectable-date restrictions. Keep application validation in the form schema and provide a message explaining how to correct invalid input.

Validation with Signal Forms
Date: โ€” ยท Valid: false

Value and events

value is a two-way model: [(value)] synchronizes the selected civil value with your signal. In a Signal Forms form, FormField performs that connection. Do not combine both bindings on the same control.

opened and closed describe the overlay lifecycle. cleared reports the clear action and touch reports field interaction. viewChange reports the calendar view; it is not a selected-date change. Use valueChange when your application needs the new value.

Accessibility and keyboard

Core manages the calendar grid, keyboard movement and overlay focus. Your application must provide a meaningful label and validation message, and associate any additional help through ariaDescribedBy. A placeholder does not replace a label.

Disabled fields cannot be edited; readonly fields retain their value without allowing changes. Test the complete form with your content and assistive technology, especially error announcements and overlay return focus.

Key
Action
ArrowDown Open a date calendar from the field.
ArrowLeft / ArrowRight / ArrowUp / ArrowDown Move one day horizontally or one week vertically in the day grid.
Home / End Move to the start or end of the calendar week.
PageUp / PageDown Move to the previous or next month in the day grid.
Enter / Space Choose the focused calendar value.
Escape Close the overlay.

API

The public NeuDateInputComponent export aliases NeuDateInputControl. Configure the control with inputs, connect its value model, and listen to outputs when you need interaction notifications. There are no public template directives or consumer imperative methods for this control.

Inputs

Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.

Name
Type
Default
Template binding
Description
ariaDescribedBystring''[ariaDescribedBy]Space-separated ids of additional descriptive elements.
ariaLabelstring''[ariaLabel]Accessible name when an appropriate visible label is unavailable.
dateFormat"short" | "medium" | "long" | "full" | "numeric"'short'[dateFormat]Display format for the date, independent of the stored typed value.
dirtybooleanfalse[dirty]Tracks whether the form value has been edited.
disabledbooleanfalse[disabled]Prevents interaction; supplied by FormField when bound to Signal Forms.
disabledDatesreadonly CivilDate[] | ((date: CivilDate) => boolean)[][disabledDates]Array of civil days or predicate identifying dates that cannot be selected.
errorMessagestring''[errorMessage]Human-readable correction message for the invalid state.
errorsreadonly ValidationError.WithOptionalFieldTree[][][errors]Structured Signal Forms validation errors.
firstDayOfWeeknumber1[firstDayOfWeek]First weekday in the calendar: 0 is Sunday, 1 is Monday.
floatingLabelbooleanfalse[floatingLabel]Float the visible label inside the field border.
hiddenbooleanfalse[hidden]Hides the control through the form state contract.
hintstring''[hint]Supporting text below the field.
inputIdstring''[inputId]Explicit input id for label and external help associations.
invalidbooleanfalse[invalid]Displays the invalid state supplied by the form or application.
labelstring''[label]Visible field label associated with its input.
localestring | nullnull[locale]Locale used to format display text; it does not convert the civil model into an instant.
maxNonNullable<V> | undefinedundefined[max]Upper permitted boundary. Supply a civil value compatible with the selected mode.
minNonNullable<V> | undefinedundefined[min]Lower permitted boundary. Supply a civil value compatible with the selected mode.
modeNeuDateMode'date'[mode]Value and picker mode: date, time, datetime, multiple, range, month or year.
namestring''[name]Native form control name.
pendingbooleanfalse[pending]Indicates that form validation is pending.
placeholderstring''[placeholder]Short format hint while empty; not a replacement for label.
presentationNeuDatePresentation'overlay'[presentation]Display the calendar in an overlay or inline in the page.
presetsreadonly NeuDatePreset[][][presets]Named preset ranges offered by the range calendar; see NeuDatePreset.
readonlybooleanfalse[readonly]Keeps the value readable without allowing changes.
requiredbooleanfalse[required]Marks the field as required; define validation in your form schema.
showMonthYearPickerbooleanfalse[showMonthYearPicker]Allow switching calendar month and year through the header chooser.
showWeekNumbersbooleanfalse[showWeekNumbers]Display week numbers next to the calendar rows.
size"sm" | "md" | "lg"'md'[size]Field size: sm, md or lg.
stepnumber1[step]Minute increment for time editing.
touchedbooleanfalse[touched]Field interaction state supplied by Signal Forms or your application.
yearRangenumber12[yearRange]Number of years shown by the year chooser.

Models

A model supports [(property)]="signal" or the [property] and (propertyChange) pair. Choose one form, not both.

Name
Type
Default
Template binding
Description
valueVnull as VDerived default[(value)]Editable civil value. Match its type to mode; use FormField or [(value)], not both.

Outputs

Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.

Name
Payload
Template binding
Description
clearedvoid(cleared)="onCleared($event)"Reports the clear action; the value model carries the resulting value.
closedvoid(closed)="onClosed($event)"Emits when the overlay closes.
openedvoid(opened)="onOpened($event)"Emits when the overlay opens.
touchvoid(touch)="onTouch($event)"Notifies the form that the control was touched; no value payload.
viewChangeNeuDateViewChangeEvent(viewChange)="onViewChange($event)"Reports a calendar view change, not a committed value change.

Templates

ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.

This component does not expose content projection or public customization templates.

Public Types

Open a type to inspect its definition and interface fields.

Theming

DateInput uses shared field, surface, text and focus roles rather than a separate date-only palette. This local wrapper changes border, surface and text for one field; the adjacent field keeps the inherited theme.

A shared token also affects other Neural controls inside the same wrapper. Keep overrides scoped, preserve readable text and focus contrast, and inspect the calendar overlay as well as the closed field.

Theming
Inherited theme
Local override

Specific tokens

This component uses shared theme tokens rather than dedicated component hooks.

Shared tokens used

Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.

Token
Purpose here
Other impact
Default / fallback
--neu-border Normal control and cell borders Shared by other Core consumers; scope the override. rgba(15, 23, 42, 0.08)
--neu-border-hover Control borders on hover Shared by other Core consumers; scope the override. rgba(15, 23, 42, 0.16)
--neu-error Invalid field or danger-action color Shared by other Core consumers; scope the override. #dc2626
--neu-error-text Error text and danger outline/ghost Button text in both themes Shared by other Core consumers; scope the override. #991b1b
--neu-focus-ring Normal keyboard-focus ring Shared by other Core consumers; scope the override. 0 0 0 var(--neu-focus-ring-width) rgba(0, 122, 255, 0.15)
--neu-primary Brand color for active controls and emphasis Shared by other Core consumers; scope the override. #007aff
--neu-primary-dark Dark brand shade; outline and ghost Button text in the light theme Shared by other Core consumers; scope the override. #005fcc
--neu-primary-fg Foreground drawn over the primary background Shared by other Core consumers; scope the override. #ffffff