Skip to content

Date Picker ​

A date picker component with range and presets. Opens a popover anchored to the trigger; on compact touch screens it becomes a bottom sheet. Picking a date closes it.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Locale & format ​

format: 'PPP' (default) | 'YYYY-MM-DD' | 'MMM d, yyyy' …

Approximate web preview — the HarmonyOS rendering is the reference.

Date range ​

Closes once both ends are picked.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SDatePicker ​

shadcn-vue Date Picker (Popover + Calendar).

Outline-button trigger (triggerWidth, default 240vp); the calendar opens in a popover below the trigger (aligned to its start) and in a bottom sheet on compact touch windows (adaptive: 'auto'). Picking a day closes it. format: 'PPP' (default: 'Oct 12, 2026' / '2026年10月12日'), 'YYYY-MM-DD', 'MMM d, yyyy' …

PropTypeDefaultDescription
value!!SparkDate | undefinedundefined
placeholderResourceStr$r('app.string.spark_pick_date')
formatstring'PPP'
localeSparkDateLocale
SparkDateLocale = 'en' | 'zh'
'en'
minDateSparkDate | undefinedundefined
maxDateSparkDate | undefinedundefined
disabledDatesSparkDateMatcher | undefinedundefined
weekStartsOnSparkWeekStart
SparkWeekStart = 0 | 1
1
disabledbooleanfalse
triggerWidthLength240trigger width (shadcn w-[240px])
adaptiveSparkAdaptive
SparkAdaptive = 'auto' | 'pointer' | 'touch'
'auto'
EventTypeDefaultDescription
onValueChange(d: SparkDate | undefined) => void() => { }

SDateRangePicker ​

Date range picker: the {@link SDatePicker} trigger with an {@link SRangeCalendar} (two months side by side when the window allows). Closes once both ends are picked.

PropTypeDefaultDescription
value!!SparkDateRange | undefinedundefined
placeholderResourceStr$r('app.string.spark_pick_date_range')
formatstring'PPP'
localeSparkDateLocale
SparkDateLocale = 'en' | 'zh'
'en'
minDateSparkDate | undefinedundefined
maxDateSparkDate | undefinedundefined
disabledDatesSparkDateMatcher | undefinedundefined
weekStartsOnSparkWeekStart
SparkWeekStart = 0 | 1
1
disabledbooleanfalse
triggerWidthLength300
adaptiveSparkAdaptive
SparkAdaptive = 'auto' | 'pointer' | 'touch'
'auto'
EventTypeDefaultDescription
onValueChange(r: SparkDateRange) => void() => { }

MIT Licensed