Skip to main content

EmailField

Use s-email-field to capture email addresses from users. Provides built-in email validation and appropriate keyboard layout.

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.

number
Default: Infinity

Specifies the maximum number of characters allowed.

string

A short hint that describes the expected value of the field.

boolean
Default: false

Whether the field needs a value. This requirement adds semantic value to the field, but it will not cause an error to appear automatically. If you want to present an error when this field is empty, you can do so with the error property.

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-email-field
label="Email"
placeholder="Enter your email"
required
value="example@shopify.com"></s-email-field>

<s-email-field
label="Email"
placeholder="Enter your email"
required
error="Enter a valid email address"
value="example.com"></s-email-field>

Preview