Email fields
Add autocomplete and native format validation for email entry.
Live preview
A valid address is required.
HTML
<div class="xsh-field xsh-measure">
<label class="xsh-label" for="xsh-contact-email">Contact email</label>
<input id="xsh-contact-email" class="xsh-input" type="email" name="contact_email" autocomplete="email" placeholder="[email protected]" required>
<small class="xsh-help">A valid address is required.</small>
</div>Installation & markup
Include the local stylesheet and script once on the page, then place the component inside a data-xsh-ui root. The example above works without a build system.
<link rel="stylesheet" href="/dist/xshna-ui.css">
<div data-xsh-ui>
<!-- Add the HTML example above -->
</div>
<script defer src="/dist/xshna-ui.js"></script>Component API
Public classes, attributes and hooks used by this example. Keep the xsh- prefix intact.
| Identifier | Contract |
|---|---|
xsh-input | Used by the example markup and component styles or behavior. |
type=email | Used by the example markup and component styles or behavior. |
required | Used by the example markup and component styles or behavior. |
autocomplete | Used by the example markup and component styles or behavior. |
Accessibility & keyboard
Native email inputs expose correct mobile keyboards and validation.
Implementation note. Never use browser validation as a substitute for server-side checks.
Interaction contract
Behavioral components use the shared delegated runtime; visual-only primitives rely on semantic HTML and CSS. Runtime controls emit bubbling xsh:* CustomEvents; bind application handlers to those events when server persistence, API data or navigation is required.