0.5.13 • Published 3 months ago

@felte/element v0.5.13

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Felte: A form library for vanilla JS (custom element)

Tests Bundle size NPM Version NPM Downloads codecov

Felte is an extensible form library originally bult for Svelte. This package aims to provide Felte's functionality using a custom element. Felte, on its most simple form, only requires you to provide a <form> element to it in order to work.

WARNING: This package is under development, things might break on updates and documentation is almost non-existent besides this README.

Features

  • Single action to make your form reactive.
  • Use HTML5 native elements to create your form. (Only the name attribute is necessary).
  • Provides stores and helper functions to handle more complex use cases.
  • No assumptions on your validation strategy. Use any validation library you want or write your own strategy.
  • Handles addition and removal of form controls during runtime.
  • Official solutions for error reporting using reporter packages.
  • Well tested. Currently at 99% code coverage and constantly working on improving test quality.
  • Supports validation with yup, zod and superstruct.
  • Easily extend its functionality.

Simple usage example

Using Svelte as an example:

<script type="module">
  import '@felte/element/felte-form';

  const felteForm = document.querySelector('felte-form');
  felteForm.configuration = {
    onSubmit: async (values) => {
      /* call to an api */
    },
  };
</script>

<felte-form>
  <form>
    <input type="text" name="email" />
    <input type="password" name="password" />
    <input type="submit" value="Sign in" />
  </form>
</felte-form>

Installation

npm install --save @felte/element

# Or if you use yarn

yarn add @felte/element

Usage

To learn more about how to use felte to handle your forms, check the official documentation.

Framework compatibility

This package should work nicely with any framework. Specially if you're using the prepareForm method of creating your form. It also works really nice with frameworks that set attributes as properties or frameworks that provide syntax to set values to properties of elements instead of attributes.

0.5.13

3 months ago

0.5.12

3 months ago

0.5.11

8 months ago

0.5.10

11 months ago

0.5.8

11 months ago

0.5.9

11 months ago

0.5.7

1 year ago

0.5.4

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.0

2 years ago

0.2.6

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago