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

1.3.0 • Public • Published

Felte: A form library for Svelte

Tests Bundle size NPM Version NPM Downloads codecov

Felte is a simple to use form library for Svelte. It is based on Svelte stores and Svelte actions for its functionality. No Field or Form components, just plain stores and actions to build your form however you like. You can see it in action in this CodeSandbox demo!

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

<script>
  import { createForm } from 'felte'

  const { form } = createForm({
    onSubmit: async (values) => {
      /* call to an api */
    },
  })
</script>

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

Installation

npm install --save felte

# Or if you use yarn

yarn add felte

Usage

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

Readme

Keywords

Package Sidebar

Install

npm i felte

Homepage

felte.dev

Weekly Downloads

3,920

Version

1.3.0

License

MIT

Unpacked Size

59.8 kB

Total Files

19

Last publish

Collaborators

  • pberganza