Skip to main content

DateField

Use s-date-field to capture date input from users. 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

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?

HTMLElement
Was this section helpful?

(event: <"s-divider">) => void
(event: <"s-divider">) => void
(event: <"s-divider">) => void
(event: <"s-divider">) => void
Was this section helpful?

Code

<s-date-field
label="Date"
required
value="2024-10-26"
details="Select a date">
</s-date-field>

<s-date-field
label="Date"
required
value="1890-10-26"
error="Date out of range"
details="Select a date">
</s-date-field>

Preview