Skip to main content

DateSpinner

Allows merchants to select a specific date, using a spinner interface.

string

A unique identifier for the element.

string
Default: ""

Current selected value for the spinner.

This uses a date in YYYY-MM-DD format.

Was this section helpful?

Learn more about registering events

(event: <"s-date-spinner">) => void

Callback when the date spinner is dismissed.

(event: <"s-date-spinner">) => void

Callback when the value changes. Only called when a different value is selected.

(event: <"s-date-spinner">) => void

Callback when the date spinner is revealed.

(event: <"s-date-spinner">) => void

Callback when the user makes a selection.

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"
/>

Preview

DateSpinner usage patterns

Show and hide DateSpinner using button commands

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)}
/>
</>;