@felte/solid
v1.2.14
Published
An extensible form library for SolidJS
Downloads
21,888
Maintainers
Readme
Felte: A form library for Solid
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.