Skip to main content

DateField

Captures date input from merchants. Provides a consistent interface for date selection, with proper validation.

string

Additional text to provide context or guidance for the field. This text is displayed along with the field and its label to offer more information or instructions to the user.

This will also be exposed to screen reader users.

boolean
Default: false

Disables the field, disallowing any interaction.

string

Indicate an error to the user. The field will be given a specific stylistic treatment to communicate problems that have to be resolved immediately.

string

A unique identifier for the element.

string

Content to use as the field label.

string

The current value for the field. If omitted, the field will be empty.

Was this section helpful?

Learn more about registering events

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

Callback when the element loses focus.

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

Callback after editing completes (typically on blur).

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

Callback when the element receives focus.

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

Callback when the user makes any changes in the field.

Was this section helpful?

Code

<s-date-field
label="Date"
value="2025-10-08"
/>

Preview

DateField usage patterns

Handle date input events

Was this section helpful?

Event handling

<s-date-field
label="Order date"
value="2024-10-26"
onInput={(event) => console.log('Input:', event.target.value)}
onChange={(event) => console.log('Change:', event.target.value)}
onFocus={(event) => console.log('Focused with:', event.target.value)}
onBlur={(event) => console.log('Blurred with:', event.target.value)}
/>