lit-forms
TypeScript icon, indicating that this package has built-in type declarations

0.4.1 • Public • Published

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

Where to go next

Package Sidebar

Install

npm i lit-forms

Weekly Downloads

11

Version

0.4.1

License

MIT

Unpacked Size

159 kB

Total Files

189

Last publish

Collaborators

  • davidkcz