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.
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.
| Part | Selector | Description |
|---|---|---|
ScDateRangePicker | div[scDateRangePicker] | The root: { from, to }. exportAs scDateRangePicker: hasValue(), draft(), canApply(), days(), nights(), pick(value), apply(), cancel(), canPick(date). |
ScDateRangePickerTrigger | button[scDateRangePickerTrigger] | Opens the calendar — behaviour only, on your button: scInputButton alone (muted while data-placeholder, set while empty), scInputGroupButton in an input group. |
ScDateRangePickerPresets | div[scDateRangePickerPresets] | A column of presets beside the calendar (a group: name it). |
ScDateRangePickerPreset | button[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 / Cancel | button[scDateRangePickerApply], button[…Cancel] | confirm: keeps the draft (disabled until whole) / drops it — closed either way. |
| Input | Type | Default | Description |
|---|---|---|---|
closeOnPick | boolean | true | 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. |
value | ScCalendarRange | null | null | Two-way, or [formField]: { from, to }. |
minDate, maxDate | Temporal.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. |
confirm | boolean | false | Picks are a draft until Apply. |
disabled, invalid, touched | boolean | false | Bound by [formField]. |