svelte-formit

1.0.4 • Public • Published

svelte-formit

enter image description here enter image description here

svelte-formit is a small unopinionated library for handling forms with svelte. svelte-formit is heavily inspired by the react-hook-form library

Installation

npm install svelte-formit
yarn install svelte-formit

Getting Started

    <script>
        import { useForm } from "svelte-formit";
        const { handleSubmit, register } = useForm();

        const onSubmit = data => {
            console.log(data);
        };
    </script>

    <form on:submit={e => handleSubmit(e, onSubmit)}>
        <input use:register name="name" />
        <input use:register type="number" name="age" />
        <button type="submit">Submit</button>
    </form>

Docs

The docs are available here

Readme

Keywords

Package Sidebar

Install

npm i svelte-formit

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

78.5 kB

Total Files

10

Last publish

Collaborators

  • galkatz373