Date Input

A date typed part by part — day, month, year — in the order of its locale. Each part is an input: a number pad on a phone, digits that move on by themselves, arrows that step. In a form, a Temporal.PlainDate; in a Date Picker, the picker's day.

FormsExperimental

Usage

Usage

We send a card on the day.

import { Component, ViewEncapsulation, signal } from '@angular/core';import {  ScDateInput,  ScField,  ScFieldDescription,  ScLabel,} from '@semantic-components/ui';
/** A date in a field: named by its label, described by its description. */@Component({

Anatomy

One part, in a field: it writes its own parts from the locale — their order and the text between them — so there is nothing to put inside it. The label, the description and the errors are the field's.

import { ScDateInput, ScField, ScFieldDescription, ScLabel } from '@semantic-components/ui';
<div scField>  <label scLabel>Birthday</label>  <div scDateInput [formField]="form.birthday"></div>  <p scFieldDescription>We send a card on the day.</p></div>

The value

A Temporal.PlainDate, through [formField] or [(value)]: null until every part is filled, and again when one is emptied. The day stays within its month — January 31, then February: the 28th. A year of one or two digits is this century's (27 → 2027). A whole date pasted — 2026-11-02, or in the locale's order — fills every part. In a Date Picker it is the picker's day, a range's end with part, and takes the picker's limits.

Keyboard

KeyDoes
Digits Fill the part; on to the next once no digit can follow (4, 12, 2026)
↑ / ↓ One up or down — the day and month wrap; an empty part starts at today
Page Up / Page Down A bigger step: the year by 5, the month by 3, the day by 7
Home / End The part's lowest / highest (the day's: the month's last)
Backspace A digit back, then the part emptied, then the part before
DeleteEmpties the part
← / →The part to the left / right, as they show
/ . -, TabThe next part (Tab: then out)

Accessibility

  • A group, named by the field's label; each part a spin button named in the locale's words (day, month, year), with its value, its range and its text — the month by its name; the field's description is read with it.
  • Each part is an input: the number pad on a phone, a part to tap.
  • Out of its limits, unavailable, or invalid once left: every part is marked invalid; the message is the field's.
  • It reads in its locale's direction — right to left in Arabic, left to right in English, whatever the page; the arrows follow the parts as they show.

Examples

Min and max

Any day in 2026.

import { Component, ViewEncapsulation, signal } from '@angular/core';import {  ScDateInput,  ScField,  ScFieldDescription,  ScLabel,} from '@semantic-components/ui';
/** minDate and maxDate: a day outside them is marked invalid. */@Component({

Unavailable

We deliver Monday to Friday.

import { Component, ViewEncapsulation, signal } from '@angular/core';import {  ScDateInput,  ScField,  ScFieldDescription,  ScLabel,} from '@semantic-components/ui';
/** unavailable: days that can’t be picked — here weekends — are marked invalid. */@Component({

Locale

import {  Component,  HostAttributeToken,  LOCALE_ID,  ViewEncapsulation,  inject,  input,  model,  signal,} from '@angular/core';

Disabled

import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScDateInput, ScField, ScLabel } from '@semantic-components/ui';
/** Disabled: its parts leave the tab order. */@Component({  selector: 'app-disabled-date-input-demo',  imports: [ScDateInput, ScField, ScLabel],  template: `    <div scField class="w-44">      <label scLabel>Start date</label>

Read-only

import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScDateInput, ScField, ScLabel } from '@semantic-components/ui';
/** Read-only: its parts can be focused and read, not changed. */@Component({  selector: 'app-read-only-date-input-demo',  imports: [ScDateInput, ScField, ScLabel],  template: `    <div scField class="w-44">      <label scLabel>Signed on</label>

Form

From today on.

import { Component, ViewEncapsulation, signal } from '@angular/core';import {  FormField,  FormRoot,  form,  required,  validate,} from '@angular/forms/signals';import {  ScButton,

Controlled

Due on 2026-11-02

import { Component, ViewEncapsulation, signal } from '@angular/core';import {  ScButton,  ScDateInput,  ScField,  ScLabel,} from '@semantic-components/ui';
/** Its value in a signal, two-way; clear() empties every part. */@Component({

RTL

يوم بدء العمل.

import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation, signal } from '@angular/core';import {  ScDateInput,  ScField,  ScFieldDescription,  ScLabel,} from '@semantic-components/ui';
/** In a right-to-left page: an Arabic date reads right to left — the day at the right; the arrows follow the parts as they show. */

API reference

Each part takes class, merged over its own (cn: a later class wins); the look is the style's segmented input, as the Time Input's.

PartSelectorDescription
ScDateInputdiv[scDateInput] The group, its parts written from the locale, in the locale's direction. data-empty, data-invalid, data-disabled, data-readonly. exportAs scDateInput: clear(), focus(options, part), segments(), date().
ScDateTimeSegmentinput[scDateTimeSegment] A part: an input (spin button) the date input writes, one per part, from the locale — not one to place or style yourself; its look is the style's (segmentedInput.segment). data-type, data-empty.
InputTypeDefaultDescription
valueTemporal.PlainDate | nullnull Two-way, or [formField]: null until every part is filled. In a Date Picker: the picker’s.
minDate, maxDateTemporal.PlainDate— A day outside them is marked invalid (in a Date Picker: the picker’s).
unavailable(date: Temporal.PlainDate) => boolean() => false Days that can’t be picked: marked invalid.
part'start' | 'end'— In a Date Picker’s range: the end it is.
disabled, readonly, required, invalid, touchedbooleanfalse Bound by [formField]: from the schema and its state.