Date Picker
Allows merchants to select a specific date, using a calendar-like picker interface.
Anchor to propertiesProperties
- string
A unique identifier for the element.
- Anchor to valuevaluestringDefault: ""
Current selected value.
The default means no date is selected.
If the provided value is invalid, no date is selected.
Otherwise:
- If
type="single"
, this is a date informat.
- If
type="multiple"
, this is a comma-separated list of dates informat.
- If
type="range"
, this is a range informat. The range is inclusive.
- If
Was this section helpful?
Anchor to eventsEvents
Learn more about registering events
- Anchor to blurblur(event: CallbackEvent<"s-date-picker">) => void
Callback when the date picker is dismissed.
- Anchor to changechange(event: CallbackEvent<"s-date-picker">) => void
Callback when the user selects a date from the picker that is different to the current value.
- Anchor to focusfocus(event: CallbackEvent<"s-date-picker">) => void
Callback when the date picker is revealed.
- Anchor to inputinput(event: CallbackEvent<"s-date-picker">) => void
Callback when the user selects a date from the picker.
CallbackEvent
- bubbles
boolean
- cancelable
boolean
- composed
boolean
- currentTarget
HTMLElementTagNameMap[T]
- detail
any
- eventPhase
number
- target
HTMLElementTagNameMap[T] | null
interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
currentTarget: HTMLElementTagNameMap[T];
bubbles?: boolean;
cancelable?: boolean;
composed?: boolean;
detail?: any;
eventPhase: number;
target: HTMLElementTagNameMap[T] | null;
}
Was this section helpful?
Code
<s-button command="--show" commandFor="date-picker">
Show
</s-button>
<s-date-picker
id="date-picker"
value="2025-10-08"
/>
Examples
Code
Default
<s-button command="--show" commandFor="date-picker"> Show </s-button> <s-date-picker id="date-picker" value="2025-10-08" />
Preview

Anchor to examplesExamples
DatePicker usage patterns
Anchor to example-command-systemCommand system
Show and hide DatePicker using button commands
Anchor to example-event-handlingEvent handling
Handle date selection events
Was this section helpful?
Command system
<>
<s-button command="--show" commandFor="date-picker">
Select Date
</s-button>
<s-date-picker
id="date-picker"
value="2024-10-26"
onChange={(event) => console.log('Date selected:', event.target.value)}
/>
</>;
Examples
Command system
Description
Show and hide DatePicker using button commands
Default
<> <s-button command="--show" commandFor="date-picker"> Select Date </s-button> <s-date-picker id="date-picker" value="2024-10-26" onChange={(event) => console.log('Date selected:', event.target.value)} /> </>;
Event handling
Description
Handle date selection events
Default
<s-date-picker value="2024-10-26" onInput={(event) => console.log('Input:', event.target.value)} onChange={(event) => console.log('Change:', event.target.value)} onFocus={(event) => console.log('Focus')} onBlur={(event) => console.log('Blur')} />