Date picker
The date picker component allows merchants to select dates using a calendar interface. Use it when merchants benefit from seeing dates in context of the full month, such as selecting dates relative to today or needing weekday context.
The component supports single dates, multiple dates, and date ranges. For tight spaces, consider using date spinner instead. For text date entry, use date field.
Supported targets
- pos.
cart. line-item-details. action. render - pos.
customer-details. action. render - pos.
customer-details. block. render - pos.
draft-order-details. action. render - pos.
draft-order-details. block. render - pos.
exchange. post. action. render - pos.
exchange. post. block. render - pos.
home. modal. render - pos.
order-details. action. render - pos.
order-details. block. render - pos.
product-details. action. render - pos.
product-details. block. render - pos.
purchase. post. action. render - pos.
purchase. post. block. render - pos.
return. post. action. render - pos.
return. post. block. render
Supported targets
- pos.
cart. line-item-details. action. render - pos.
customer-details. action. render - pos.
customer-details. block. render - pos.
draft-order-details. action. render - pos.
draft-order-details. block. render - pos.
exchange. post. action. render - pos.
exchange. post. block. render - pos.
home. modal. render - pos.
order-details. action. render - pos.
order-details. block. render - pos.
product-details. action. render - pos.
product-details. block. render - pos.
purchase. post. action. render - pos.
purchase. post. block. render - pos.
return. post. action. render - pos.
return. post. block. render
Anchor to PropertiesProperties
Configure the following properties on the DatePicker component.
- Anchor to idididstringstring
A unique identifier for the element used for targeting with CSS, JavaScript, or accessibility features.
- Anchor to valuevaluevaluestringstringDefault: ""Default: ""
The currently selected date value in ISO 8601 format (
, for example,"2024-05-15"). An empty string means no date is selected. Other date formats require conversion before setting this property. Validation occurs when the user finishes editing (on blur), rather than on every keystroke, so invalid dates are flagged after completing entry.
Anchor to EventsEvents
The date picker component provides event callbacks for handling user interactions. Learn more about handling events.
- Anchor to blurblurblur(event: CallbackEvent<"s-date-picker">) => void(event: CallbackEvent<"s-date-picker">) => void
Called when the element loses focus.
- Anchor to changechangechange(event: CallbackEvent<"s-date-picker">) => void(event: CallbackEvent<"s-date-picker">) => void
Called after editing completes, typically on blur.
- Anchor to focusfocusfocus(event: CallbackEvent<"s-date-picker">) => void(event: CallbackEvent<"s-date-picker">) => void
Called when the element receives focus.
- Anchor to inputinputinput(event: CallbackEvent<"s-date-picker">) => void(event: CallbackEvent<"s-date-picker">) => void
Called when the user makes any changes in the field.
CallbackEvent
Represents the event object passed to callback functions when interactive events occur. Contains metadata about the event, including the target element, event phase, and propagation behavior.
- bubbles
Whether the event bubbles up through the DOM tree.
boolean - cancelable
Whether the event can be canceled.
boolean - composed
Whether the event will trigger listeners outside of a shadow root.
boolean - currentTarget
The element that the event listener is attached to.
HTMLElementTagNameMap[T] - detail
Additional data associated with the event.
any - eventPhase
The current phase of the event flow.
number - target
The element that triggered the event.
HTMLElementTagNameMap[T] | null
Anchor to ExamplesExamples
Anchor to Select dates with a calendar pickerSelect dates with a calendar picker
Enable visual date selection using a date picker component with a calendar interface. This example shows a basic date picker with month view and date selection.Select dates with a calendar picker

Select dates with a calendar picker
Anchor to Control picker visibilityControl picker visibility
Control date picker visibility programmatically using the command system with show and hide methods. This example demonstrates using button commands to display or dismiss the calendar picker, enabling custom trigger patterns for date selection workflows.Control picker visibility
Anchor to Handle date selection eventsHandle date selection events
Subscribe to date selection events to respond when merchants pick a date from the calendar. This example shows how to handle onChange events to capture selected dates, enabling validation, scheduling logic, or dynamic updates based on the chosen date.Handle date selection events
Anchor to Best practicesBest practices
- Choose for calendar-based selection: Use date picker when users benefit from seeing a calendar view, like selecting dates relative to today or needing weekday context. Use date spinner for tight spaces or date field when users know the exact date.
- Provide adequate space: Ensure sufficient spacing around the picker to avoid interfering with on-screen keyboards or other interactive elements.