Date Picker
A day — or several — picked in the calendar, or typed (a range: the Date Range Picker); written in the app’s language; a [formField].
Usage
import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, type ScCalendarValue, ScDatePicker, ScDatePickerTrigger, ScInputButton, ScPopover, ScPopoverPortal, ScPopoverProvider, injectFormatDate,} from '@semantic-components/ui';import { SiCalendarIcon, SiChevronLeftIcon, SiChevronRightIcon,} from '@semantic-icons/lucide-icons';
/** A button showing the day, opening the calendar — focus on its day. A pick closes it, focus back on the button; Escape closes it too. */@Component({ selector: 'app-date-picker-usage-demo', imports: [ ScInputButton, ScDatePicker, ScDatePickerTrigger, ScPopoverProvider, ScPopoverPortal, ScPopover, ScCalendar, ScCalendarHeader, ScCalendarPrevious, ScCalendarNext, SiCalendarIcon, SiChevronLeftIcon, SiChevronRightIcon, ], template: ` <div scDatePicker #dp="scDatePicker" [(value)]="date" class="w-fit"> <div scPopoverProvider [origin]="trigger.overlayOrigin" alignment="start"> <button scInputButton scDatePickerTrigger #trigger="scDatePickerTrigger" class="w-64" > <svg siCalendarIcon></svg> <span>{{ formatDate(date()) || 'Pick a date' }}</span> </button> <ng-template scPopoverPortal> <div scPopover class="w-auto p-0" aria-label="Choose a date"> <div scCalendar initialFocus aria-label="Choose a date" [mode]="dp.mode()" [value]="dp.draft()" (valueChange)="dp.pick($event)" > <div scCalendarHeader> <button scCalendarPrevious> <svg siChevronLeftIcon></svg> <span class="sr-only">Previous month</span> </button> <button scCalendarNext> <svg siChevronRightIcon></svg> <span class="sr-only">Next month</span> </button> </div> </div> </div> </ng-template> </div> </div> <p class="text-muted-foreground text-sm" data-testid="picked"> {{ formatDate(date()) || 'Nothing picked.' }} </p> `, host: { class: 'flex w-full flex-col items-center gap-3' }, encapsulation: ViewEncapsulation.None,})export class DatePickerUsageDemo { // The value as written: Intl's, in the user's digits — or your own format. private readonly formatDate = injectFormatDate(); private readonly date = signal<ScCalendarValue>(null);}Anatomy
The picker holds the value; a popover holds the calendar, opened by the trigger — a button showing the day, or an icon button in an input group beside a typed input (the popover then anchored to the group). Presets and Apply / Cancel buttons are optional.
import { ScDatePicker, ScDatePickerTrigger, ScDatePickerPresets, ScDatePickerPreset, ScDatePickerApply, ScDatePickerCancel, ScPopoverProvider, ScPopoverPortal, ScPopover, ScCalendar, ScCalendarHeader, ScCalendarPrevious, ScCalendarNext,} from '@semantic-components/ui';<div scDatePicker #dp="scDatePicker" [(value)]="…"> <div scPopoverProvider [origin]="trigger.overlayOrigin"> <button scInputButton scDatePickerTrigger #trigger="scDatePickerTrigger">…</button> <ng-template scPopoverPortal> <div scPopover aria-label="…"> <div scDatePickerPresets aria-label="…"> <button scDatePickerPreset [value]="…">…</button> </div> <div scCalendar [mode]="dp.mode()" [value]="dp.draft()" (valueChange)="dp.pick($event)"> <div scCalendarHeader> <button scCalendarPrevious>…</button> <button scCalendarNext>…</button> </div> </div> <button scDatePickerCancel>…</button> <button scDatePickerApply>…</button> </div> </ng-template> </div></div>Accessibility
- The trigger opens a dialog (the popover) holding the calendar, a grid: focus goes to the chosen day (or today); the arrow keys move by day and week, Home and End, Page Up and Page Down by month (with Shift, by year); Enter or Space picks.
- Closing, the same in every picker: a pick that makes the value whole closes it, focus back on the trigger (several days: never by itself); with [closeOnPick]="false" it stays open until Enter, Escape or a click outside. With confirm, nothing closes by itself: Apply (or Enter) keeps what is picked; Cancel, Escape or a click outside leave the value as it was before it opened.
- Name every icon button and the popover (an sr-only span, an aria-label): the library writes no words.
- In a field, the trigger or the typed input takes its label and description; invalid (aria-invalid) once the calendar has closed, with Signal Forms.
- The value is written in the app’s language (Intl), and the calendar follows the page’s direction.
Examples
Stays open
Nothing picked.
import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, type ScCalendarValue, ScDatePicker, ScDatePickerTrigger, ScInputButton,Typed
Typed, or picked: the locale’s numeric order (here 10/14/2026) or ISO, read on Enter or leaving; text that is not a day stays, marked. The button in the field opens the calendar.
Month, day, year.
Oct 14, 2026
import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, type ScCalendarValue, ScDateInput, ScDatePicker,Date of birth
startView="year" on the calendar: empty, it opens on the years — a year, then its month, then its day; with a date set, on the days of its month, to fix the day. 18 or older: maxDate is today minus 18 years.
You must be 18 or older.
Nothing picked.
import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, type ScCalendarValue, ScDateInput, ScDatePicker,Multiple
Several days, written as a list in the app’s language; it stays open while you pick.
Nothing picked.
import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, type ScCalendarValue, ScDatePicker, ScDatePickerTrigger, ScInputButton,Constraints
minDate, maxDate and unavailable days on the picker — given to its calendar, and kept for typed days too: weekends cannot be picked.
Nothing picked.
import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, type ScCalendarValue, ScDateInput, ScDatePicker,In a form
A [formField]: required, from the schema; marked once the calendar has closed — the trigger, then its field.
import { Component, ViewEncapsulation, signal } from '@angular/core';import { FormField, FormRoot, form, required } from '@angular/forms/signals';import { ScButton, ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, type ScCalendarValue, ScDatePicker,Locale
locale="fr-FR" and a long format: the value, the calendar and the typed order (jj/mm/aaaa) in French.
14 octobre 2026
import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, LOCALE_ID, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, type ScCalendarValue, ScDateInput, ScDatePicker,RTL
In a right-to-left page: the button and the calendar mirrored (its arrows too), the day written in Arabic.
لم يُختر شيء.
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation, signal } from '@angular/core';import { ScCalendar, ScCalendarHeader, ScCalendarNext, ScCalendarPrevious, type ScCalendarValue, ScDatePicker, ScDatePickerTrigger,API reference
Each part takes class, merged over the style (cn: a later class wins). The calendar and the popover are their own components: see Calendar and Popover.
| Part | Selector | Description |
|---|---|---|
ScDatePicker | div[scDatePicker] | Holds the value: [(value)] (a day, or days — the calendar's); mode ('single', 'multiple'); minDate, maxDate, unavailable; closeOnPick (a whole value closes it; default true); confirm (picks a draft until Apply); a [formField] (disabled, invalid, touched). exportAs scDatePicker: hasValue(), draft(), pick(), apply(), cancel(). The trigger writes the value: injectFormatDate() (the user's locale and digits), or your own format. |
ScDatePickerTrigger | button[scDatePickerTrigger] | Opens the calendar — behaviour only, on your button: scInputButton (a field's look, muted while data-placeholder, set while empty), or scInputGroupButton in an input group (icon only: name it). Your icon and text. exportAs scDatePickerTrigger: overlayOrigin. |
ScDatePickerPresets | div[scDatePickerPresets] | The presets, in a column beside the calendar. Name it. |
ScDatePickerPreset | button[scDatePickerPreset] | A ready value (today, the last 7 days…): [value], picked as the calendar's would be; pressed while it is the value. variant ('ghost'), size ('sm'); your text. |
ScDatePickerApply, ScDatePickerCancel | button[scDatePickerApply], button[scDatePickerCancel] | With confirm: Apply keeps the draft and closes (disabled until it is whole); Cancel drops it, as Escape. The style's button (default / outline, sm); your text. |