Date Spinner
Allows merchants to select a specific date, using a spinner interface.
Anchor to propertiesProperties
- string
A unique identifier for the element.
- Anchor to valuevaluestringDefault: ""
Current selected value for the spinner.
This uses a date in
format.
Was this section helpful?
Anchor to eventsEvents
Learn more about registering events
- Anchor to blurblur(event: CallbackEvent<"s-date-spinner">) => void
Callback when the date spinner is dismissed.
- Anchor to changechange(event: CallbackEvent<"s-date-spinner">) => void
Callback when the value changes. Only called when a different value is selected.
- Anchor to focusfocus(event: CallbackEvent<"s-date-spinner">) => void
Callback when the date spinner is revealed.
- Anchor to inputinput(event: CallbackEvent<"s-date-spinner">) => void
Callback when the user makes a selection.
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-spinner">
Show
</s-button>
<s-date-spinner
id="date-spinner"
value="2021-09-17"
/>
Examples
Code
Default
<s-button command="--show" commandFor="date-spinner"> Show </s-button> <s-date-spinner id="date-spinner" value="2021-09-17" />
Preview

Anchor to examplesExamples
DateSpinner usage patterns
Anchor to example-command-systemCommand system
Show and hide DateSpinner 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-spinner">
Select Date
</s-button>
<s-date-spinner
id="date-spinner"
value="2024-10-26"
onChange={(event) => console.log('Date selected:', event.target.value)}
/>
</>;
Examples
Command system
Description
Show and hide DateSpinner using button commands
Default
<> <s-button command="--show" commandFor="date-spinner"> Select Date </s-button> <s-date-spinner id="date-spinner" value="2024-10-26" onChange={(event) => console.log('Date selected:', event.target.value)} /> </>;
Event handling
Description
Handle date selection events
Default
<s-date-spinner 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')} />