DatePicker
A timezone-safe date, range, multiple, month, year, time and datetime control with localized parsing, accessible grid navigation and typed Angular Forms integration.
GET STARTED
Import
Import the canonical standalone component from its granular secondary entry point.
Basic date selection
The model is a plain NeuralDateParts object. It survives SSR, JSON serialization and hydration without an implicit timezone conversion.
Model: 2026-08-18
Day, month and year views
The day header moves into month and year selection. Dedicated picker modes expose the same navigation for month-only and year-only workflows; week numbers and adjacent days are opt-in.
Single, range and multiple
Range retains an incomplete start and previews the interval on hover. Multiple selection toggles immutable date entries and can keep the overlay open.
Availability and calendar constraints
Bounds, blocked dates, weekdays and predicates compose into one deterministic disabled state. This demo blocks weekends, two explicit dates, and days 13 and 21.
Time and datetime
Use 12/24-hour display, optional seconds and independent step sizes. Datetime bounds validate the complete draft before it is committed.
Localization and week ownership
Runtime locale controls labels, strict display format, month and weekday names, direction and default week start. A component override never mutates the application locale. Use provideNeuralNg({ locale }) for the application default, or bind [locale] for an isolated runtime override.
All three Angular Forms APIs
The same typed value contract works with Reactive Forms, template-driven forms and Angular Signal Forms without a second state store or compatibility wrapper.
Typed templates
Day, header, footer and all three navigation icon templates expose guarded contexts while the component retains behavior.
Semantic events
Model synchronization remains separate from user intent and overlay/view lifecycle events.
No semantic event yet.
Unstyled and typed class slots
Unstyled removes NeuralNg visual classes but preserves structural hooks, ARIA, keyboard behavior and overlay ownership. This deliberately distinct example proves consumer ownership.
A calendar operable without a pointer
DatePicker follows the dialog/grid interaction model, preserves focus ownership and exposes localized full-date announcements.
Semantic model
Trigger
aria-haspopup="dialog", expanded state and the stable panel relationship remain on the input.
Calendar
Native grid, row and gridcell roles use roving tabindex. Full weekday and date names remain available to assistive technology.
Keyboard contract
| Key | Behavior |
|---|---|
| Arrow keys | Move by day/week; time fields step their active unit. |
| Home / End | Move to the locale-aware start/end of the current week. |
| Page Up / Down | Move one month; Shift moves one year. |
| Enter / Space | Select the active value. |
| Escape | Cancel the draft, close and restore focus. |
Focus and overlay
The shared Popover foundation uses the browser top layer, matches trigger width, flips/clamps inside the viewport and restores focus on dismissal. Destroying the control releases listeners and pending focus work.
Locale and RTL
Month/day names, messages, strict date format and week start come from NeuralLocaleService or a component override. RTL reverses logical horizontal navigation without changing the serialized value model.
DatePicker API
Canonical export: NeuralDatePicker. DatePickerComponent remains a deprecated compatibility alias.
Models
| Model | Type | Default |
|---|---|---|
| value | NeuralDatePickerValue<TMode, TPickerMode> | null |
Inputs
The complete input surface is grouped by responsibility.
Mode and availability
selectionMode, pickerMode, minDate, maxDate, minDateTime, maxDateTime, disabledDates, disabledDays, dateFilter, isDateDisabled.
Calendar and time
today, firstDayOfWeek, showOtherMonths, selectOtherMonths, showWeekNumbers, showSeconds, hourFormat, hourStep, minuteStep, secondStep.
Commit behavior
closeOnSelect, footerActions, showQuickActions, showApplyActions, clearable.
Form and DOM
disabled, readonly, required, invalid, pending, touched, dirty, name, datePickerId, ariaLabel, placeholder, locale, fluid.
Visual ownership
unstyled, datePickerClass, iconClass, clearIconClassName, previousIconClass, nextIconClass, classes.
Outputs
valueChangeselectionChangeselectedclearedopenChangeopenedclosedviewChangedmonthChangedyearChangedinvalidInputtouchvalueChange synchronizes the model. Semantic outputs describe explicit user intent and do not fire for unrelated programmatic writes.
Typed template directives
neuralDatePickerDay, neuralDatePickerHeader, neuralDatePickerFooter, neuralDatePickerTriggerIcon, neuralDatePickerPreviousIcon and neuralDatePickerNextIcon.
Timezone-safe utilities
The entry point exports strict parsing/formatting, comparison, clamping, calendar construction, ISO week, native Date boundary conversion and date/time arithmetic helpers. Use parseNeuralLocaleDate instead of browser-dependent Date.parse.
Forms contract
NeuralDatePicker implements FormValueControl. Disabled, readonly, required, invalid, pending, touched and dirty state can flow through Angular Forms; do not add another CVA or mirror the value.
DatePicker tokens
Component variables fall back to semantic NeuralNg primary, surface, border, text and focus tokens.
Design tokens
--neural-date-picker-widthComponent inline size.
--neural-date-picker-min-heightComponent minimum block size.
--neural-date-picker-paddingComponent internal spacing.
--neural-date-picker-font-sizeComponent font size.
--neural-date-picker-colorComponent foreground color.
--neural-date-picker-backgroundComponent background surface.
--neural-date-picker-borderComponent border shorthand.
--neural-date-picker-radiusComponent corner radius.
--neural-date-picker-shadowComponent box shadow.
--neural-date-picker-focus-ringComponent keyboard focus ring.
--neural-date-picker-icon-colorIcon foreground color.
--neural-date-picker-icon-color-hoverHovered icon foreground color.
--neural-date-picker-trigger-borderTrigger border shorthand.
--neural-date-picker-panel-paddingPanel internal spacing.
--neural-date-picker-panel-colorPanel foreground color.
--neural-date-picker-panel-backgroundPanel background surface.
--neural-date-picker-panel-borderPanel border shorthand.
--neural-date-picker-panel-radiusPanel corner radius.
--neural-date-picker-panel-shadowPanel box shadow.
--neural-date-picker-panel-backdrop-filterPanel backdrop filter effect.
--neural-date-picker-grid-gapSpacing between grid items.
--neural-date-picker-weekday-colorWeekday foreground color.
--neural-date-picker-day-radiusDay corner radius.
--neural-date-picker-day-background-hoverHovered day background surface.
--neural-date-picker-day-background-selectedSelected day background surface.
--neural-date-picker-day-color-selectedSelected day foreground color.
--neural-date-picker-day-color-outsideForeground color for days that belong to an adjacent month.
--neural-date-picker-today-colorToday foreground color.
--neural-date-picker-disabled-opacityDisabled opacity.
--neural-date-picker-border-color-invalidInvalid component border color.
Typed class slots
NeuralDatePickerClasses covers root/input/trigger/panel, announcements, every calendar view, week/day states, range states, time fields and footer actions. Explicit aliases trigger and rangeStart/Middle/End remain supported.
Cascade order
Global provideNeuralNg({ unstyled: true }), Field-owned unstyled mode and component unstyled all retain behavior and structural *-root hooks.