Email field
The email field component captures email address input. Use it to collect email information in forms, customer profiles, or contact workflows.
The email field component doesn't perform automatic email validation. Implement your own validation logic, and use the error property to display validation results.
Supported targets
Supported targets
Anchor to PropertiesProperties
Configure the following properties on the EmailField component.
- Anchor to detailsdetailsdetailsstringstring
The 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.
- Anchor to disableddisableddisabledbooleanbooleanDefault: falseDefault: false
Whether the field is disabled, preventing user interaction. Use when the field is temporarily unavailable due to application state, permissions, or dependencies.
- Anchor to errorerrorerrorstringstring
An error message to indicate a problem to the user. The field will be given specific stylistic treatment to communicate issues that must be resolved immediately.
- Anchor to idididstringstring
A unique identifier for the element used for targeting with CSS, JavaScript, or accessibility features.
- Anchor to labellabellabelstringstring
The content to use as the field label that describes the email information being requested.
- Anchor to maxLengthmaxLengthmaxLengthnumbernumberDefault: InfinityDefault: Infinity
The maximum number of characters allowed in the text field.
- Anchor to placeholderplaceholderplaceholderstringstring
A short hint that provides guidance about the expected value of the field.
- Anchor to requiredrequiredrequiredbooleanbooleanDefault: falseDefault: false
Whether the field needs a value. This requirement adds semantic value to the field but doesn't cause an error to appear automatically. Use the
errorproperty to present validation errors.- Anchor to valuevaluevaluestringstring
The current email address entered in the field. An empty string means no email is entered.
Anchor to SlotsSlots
The email field component supports slots for additional content placement within the field. Learn more about using slots.
- Anchor to accessoryaccessoryaccessoryHTMLElementHTMLElement
The additional content to be displayed in the field. Commonly used to display clickable text or action elements. Only button and clickable components with text content only are supported in this slot. Use the
slot="accessory"attribute to place elements in this area.
Anchor to EventsEvents
The email field component provides event callbacks for handling user interactions. Learn more about handling events.
- Anchor to blurblurblur(event: CallbackEvent<"s-email-field">) => void(event: CallbackEvent<"s-email-field">) => void
Called when the element loses focus.
- Anchor to changechangechange(event: CallbackEvent<"s-email-field">) => void(event: CallbackEvent<"s-email-field">) => void
Called after editing completes, typically on blur.
- Anchor to focusfocusfocus(event: CallbackEvent<"s-email-field">) => void(event: CallbackEvent<"s-email-field">) => void
Called when the element receives focus.
- Anchor to inputinputinput(event: CallbackEvent<"s-email-field">) => void(event: CallbackEvent<"s-email-field">) => 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 Capture email addresses with an email fieldCapture email addresses with an email field
Capture email address input using an email field component. This example shows a basic email field with a label for collecting email information.Capture email addresses with an email field

Capture email addresses with an email field
Add action buttons to the email field using the accessory slot for quick actions like clearing input or verifying email addresses. This example shows how to use s-button and s-clickable components in the accessory slot, providing inline functionality within the email input context.
Add accessory buttons
Anchor to Handle email input eventsHandle email input events
Subscribe to email input events to respond when merchants enter email addresses. This example demonstrates handling onChange, onInput, onFocus, and onBlur events for real-time email validation, duplicate checking, or autosave functionality.Handle email input events
Anchor to Best practicesBest practices
- Write descriptive labels: Use specific labels like "Customer Email" or "Receipt Email Address" rather than generic "Email."
- Provide context in details: Use
detailsfor additional context like "Required for digital receipts" or "We'll send order updates to this address." - Write actionable error messages: Provide clear validation messages like "Please enter a valid email address" that help users correct their input.
Anchor to LimitationsLimitations
The accessory slot supports only button and clickable components—other component types can't be used in the accessory slot.