Forms framework for lit inspired by Angular Forms.
⚠️ Please note that all versions prior to 1.0.0 of this library do not follow SemVer standards, thus, minor versions may introduce breaking changes.
$ npm install --save lit-forms
const form = FB.form(this, {
email: FB.control(''),
password: FB.control(''),
});
<form
${form.attach()}
@lf:submit="${() => {
console.log(form.value);
}}"
>
<div>
<label for="email">E-mail:</label>
<input id="email" type="email" required ${form.components.email.attach()}>
</div>
<div>
<label for="password">Password:</label>
<input id="password" type="password" required ${form.components.password.attach()}>
</div>
</form>
- Support for native, Spectrum, Shoelace, vaadin or custom form fields
- Built-in validation
- Custom validators
- Structured form data with groups and arrays
- Zero dependencies