Skip to content

Latest commit

 

History

History
 
 

solid

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Felte: A form library for Solid

Tests Bundle size NPM Version codecov

Felte is a simple to use form library originally built for Svelte but only needing minor modifications to work well with Solid. For Solid its functionality is based on the use directive. No Field or Form components, just plain stores and directives 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

import { createForm } from '@felte/solid';

const Form = () => {
  const { form } = createForm({
    // ...
    onSubmit: (values) => console.log(values),
    // ...
  });
  return (
    <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/solid

# Or, if you use yarn

yarn add @felte/solid

Usage

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