Date Range Picker

A range of days, picked in a calendar — the start, then the end — typed in a Date Range Input, or a preset; written as one span in your language. Its own part: a range, nothing else.

FormsExperimental

Usage

Usage

Nothing picked.

import { Component, ViewEncapsulation, signal } from '@angular/core';import {  ScCalendar,  ScCalendarHeader,  ScCalendarNext,  ScCalendarPrevious,  type ScCalendarRange,  ScDateRangePicker,  ScDateRangePickerTrigger,  ScInputButton,

Anatomy

The picker holds a trigger — alone, showing the value as you write it (injectFormatDate(), or your own format), or an icon beside your scDateRangeInput in an input group — and the popover: your Calendar in range mode, and if you want presets beside it, the duration and Apply / Cancel under it.

import {  ScCalendar,  ScDateRangePicker,  ScDateRangePickerApply,  ScDateRangePickerCancel,  ScDateRangePickerDuration,  ScDateRangePickerPreset,  ScDateRangePickerPresets,  ScDateRangePickerTrigger,} from '@semantic-components/ui';
<div scDateRangePicker #dp="scDateRangePicker" [(value)]="range">  <div scPopoverProvider [origin]="trigger.overlayOrigin">    <button scInputButton scDateRangePickerTrigger #trigger="scDateRangePickerTrigger">      …icon… {{ formatDate(range()) || 'Pick dates' }}    </button>    <ng-template scPopoverPortal>      <div scPopover aria-label="Choose dates">        <div scDateRangePickerPresets aria-label="Presets">          <button scDateRangePickerPreset [value]="…">…</button>        </div>        <div scCalendar mode="range" initialFocus [value]="dp.draft()"             (valueChange)="dp.pick($event)">…</div>        <span scDateRangePickerDuration></span>        <button scDateRangePickerCancel>Cancel</button>        <button scDateRangePickerApply>Apply</button>      </div>    </ng-template>  </div></div>

Picking

The first click sets the start, the second the end. With confirm, picks and presets are a draft until Apply — Cancel, Escape or a click outside drop it. The calendar shows draft() and reports to pick().

Closing — the same in every picker: each pick moves on to the next part — the start to the end, and the popover closes once the value is whole, focus back on the trigger. With [closeOnPick]="false" the picks still move on, but it stays open until Enter (keeping what is picked), Escape or a click outside. The arrow keys only browse. 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.

Give the calendar the picker's minDate, maxDate and unavailable too; a typed field takes them from the picker.

Accessibility

  • The trigger says it opens a dialog and whether it is open; the popover and the calendar are named by you.
  • A preset is pressed (aria-pressed) while it is the value; the presets are a group you name.
  • The duration is said as it changes.
  • Typing is always there with a Date Range Input: the calendar is another way.

Examples

Typed

Stay

Oct 14 – 18, 2026

import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, ViewEncapsulation, signal } from '@angular/core';import {  ScCalendar,  ScCalendarHeader,  ScCalendarNext,  ScCalendarPrevious,  type ScCalendarRange,  ScDateInput,  ScDateRangeInput,

Presets

Nothing picked.

import { Component, ViewEncapsulation, signal } from '@angular/core';import {  ScCalendar,  ScCalendarHeader,  ScCalendarNext,  ScCalendarPrevious,  type ScCalendarRange,  ScDateRangePicker,  ScDateRangePickerPreset,  ScDateRangePickerPresets,

Apply

Nov 26 – Dec 2, 2026

import { Component, ViewEncapsulation, signal } from '@angular/core';import {  ScCalendar,  ScCalendarFooter,  ScCalendarHeader,  ScCalendarNext,  ScCalendarPrevious,  type ScCalendarRange,  ScDateRangePicker,  ScDateRangePickerApply,

Duration

Nov 2 – 6, 2026

import { Component, ViewEncapsulation, signal } from '@angular/core';import {  ScCalendar,  ScCalendarHeader,  ScCalendarNext,  ScCalendarPrevious,  type ScCalendarRange,  ScDateRangePicker,  ScDateRangePickerDuration,  ScDateRangePickerTrigger,

Constraints

Nothing picked.

import { Component, ViewEncapsulation, signal } from '@angular/core';import {  ScCalendar,  ScCalendarHeader,  ScCalendarNext,  ScCalendarPrevious,  type ScCalendarRange,  ScDateRangePicker,  ScDateRangePickerTrigger,  ScInputButton,

In a form

import { Component, ViewEncapsulation, signal } from '@angular/core';import { FormField, FormRoot, form, validate } from '@angular/forms/signals';import {  ScButton,  ScCalendar,  ScCalendarHeader,  ScCalendarNext,  ScCalendarPrevious,  type ScCalendarRange,  ScDateRangePicker,

RTL

2‏/11‏/2026 – 6‏/11‏/2026

import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation, signal } from '@angular/core';import {  ScCalendar,  ScCalendarHeader,  ScCalendarNext,  ScCalendarPrevious,  type ScCalendarRange,  ScDateRangePicker,  ScDateRangePickerTrigger,

API reference

Each part takes class, merged over its own (cn: a later class wins). The calendar is the Calendar, the typed field the Date Range Input.

PartSelectorDescription
ScDateRangePickerdiv[scDateRangePicker] The root: { from, to }. exportAs scDateRangePicker: hasValue(), draft(), canApply(), days(), nights(), pick(value), apply(), cancel(), canPick(date).
ScDateRangePickerTriggerbutton[scDateRangePickerTrigger] Opens the calendar — behaviour only, on your button: scInputButton alone (muted while data-placeholder, set while empty), scInputGroupButton in an input group.
ScDateRangePickerPresetsdiv[scDateRangePickerPresets] A column of presets beside the calendar (a group: name it).
ScDateRangePickerPresetbutton[scDateRangePickerPreset] [value]: a ready range, picked as the calendar’s pick would be; aria-pressed while it is the value. scDateRangePresets() gives the common ones.
ScDateRangePickerDuration[scDateRangePickerDuration] The draft’s days, both ends counted, in the locale’s words (Intl); aria-live. Nights: nights(), your words.
ScDateRangePickerApply / Cancelbutton[scDateRangePickerApply], button[…Cancel] confirm: keeps the draft (disabled until whole) / drops it — closed either way.
InputTypeDefaultDescription
closeOnPickbooleantrue Each pick moves on to the next part; the popover closes once the value is whole. False: it stays open until Enter, Escape or a click outside.
valueScCalendarRange | nullnull Two-way, or [formField]: { from, to }.
minDate, maxDateTemporal.PlainDate— The days that can be picked — give them to the calendar too.
unavailable(date: Temporal.PlainDate) => boolean() => false Days that can’t be picked — the calendar’s too.
confirmbooleanfalse Picks are a draft until Apply.
disabled, invalid, touchedbooleanfalse Bound by [formField].