
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
aurelia2-forms
Advanced tools
Form state and validation helpers for Aurelia 2. Provides:
<au-form> custom elementau-field custom attributeFormController + FieldState models@aurelia/validationnpm install aurelia2-forms
@aurelia/validation is a dependency of this package; register its configuration
when you want rule-based validation.
import { AureliaFormsConfiguration } from 'aurelia2-forms';
import { ValidationConfiguration } from '@aurelia/validation';
Aurelia.register(AureliaFormsConfiguration, ValidationConfiguration);
<au-form submit.call="save($event)" form.bind="form">
<input
name="email"
au-field="value.bind: email; validators.bind: [required(), email()]"
/>
<button type="submit">Save</button>
</au-form>
import { FormController, required, email } from 'aurelia2-forms';
export class Page {
email = '';
form: FormController | null = null;
save({ value }: { value: Record<string, unknown> }) {
console.log(value);
}
}
<au-form> APIBindings:
submit.call or submit.bind: callback invoked after validationvalidate-on-submit.bind (default true): run form.validate() on submitform.bind: two-way binding to the FormControllervalidation-model.bind: object to validate with @aurelia/validationvalidation-object-tag.bind: optional tag for ruleset selectionsubmit receives { form, value, event }.
<au-form> registers the FormController in DI so nested components can inject it:
import { IFormController } from 'aurelia2-forms';
export class Child {
constructor(@IFormController private readonly form) {}
}
au-field APIau-field wires an input to a FieldState and synchronizes value + validation.
Bindings:
value.bind: two-way field valuevalidators.bind: array of validator functionsvalidate-on.bind: 'submit' | 'change' | 'blur' (default submit)form.bind: attach to a specific form (optional)validation-model.bind: override validation model (optional)validation-property.bind: property name for rule-based validation (optional)The field name defaults to the element's name attribute, then id, then "field".
You can also set au-field="fieldName" if you want to set it explicitly.
Example:
<input
name="firstName"
au-field="value.bind: person.firstName; validate-on.bind: 'change'"
/>
required()email()minLength(n) / maxLength(n)min(n) / max(n)pattern(regex)Custom validators are simple functions:
import type { ValidatorFn } from 'aurelia2-forms';
const startsWithA: ValidatorFn<string> = (value) =>
value?.startsWith('A') ? null : 'Must start with A';
FormController tracks aggregate state.
validate() -> Promise<boolean>reset()value (object of field values)valid (boolean)errors (map of field -> string[])getField(name)FieldState exposes:
value, touched, dirty, errors, validvalidate()reset()If you register ValidationConfiguration and pass a validation-model, field
validation will also run Aurelia validation rules (in addition to local validators).
import { IValidationRules } from '@aurelia/validation';
validationRules.on(person).ensure('email').required();
<au-form validation-model.bind="person" form.bind="form">
<input name="email" au-field="value.bind: person.email" />
</au-form>
If the field name does not match the model property, use validation-property:
<input
name="emailAddress"
au-field="value.bind: person.email"
validation-property.bind="'email'"
/>
FAQs
Form state and validation helpers for Aurelia 2
We found that aurelia2-forms demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.