Nexanexa
Step 8

Forms with @nexa/forms

Progressive enhancement over the browser's native Constraint Validation API — no proprietary rules, no reinventing HTML5 validation.

Marking the form

<form data-nexa-form>
    <label for="email">Email</label>
    <input id="email" name="email" type="email" required />
    <p data-nexa-error-for="email"></p>
    <button type="submit">Send</button>
</form>

data-nexa-form activates the progressive enhancement; data-nexa-error-for shows the native validation message for the matching field.

Zero cost when unused

// No page without <form data-nexa-form> downloads @nexa/forms.
// Zero config, zero bytes when unused.

initForms() is only injected if the page has a real <form data-nexa-form> — same criterion as the rest of Nexa.