lit-forms
v0.4.1
Published
Lit forms inspired by angular reactive forms
Downloads
19
Maintainers
Readme
lit-forms
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.
Installation
$ npm install --save lit-forms
Usage
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>
Features
- Support for native, Spectrum, Shoelace, vaadin or custom form fields
- Built-in validation
- Custom validators
- Structured form data with groups and arrays
- Zero dependencies
Documentation
- Creating form builder (FB)
- Submitting form
- Structuring forms
- Custom form fields implementation
- Validation
- Events
- States
- Rxjs