랭킹으로 돌아가기

open-circle/formisch

TypeScriptformisch.dev

The lightweight, schema-first, and fully type-safe form library for React, Solid, Vue, Svelte and more.

formpreactqwikreactschemasignalssolidsveltetypescriptvalidationvuevalibot
스타 성장
스타
1.1k
포크
31
주간 성장
이슈
17
6008001k
25년 7월25년 11월26년 3월26년 7월
아티팩트npmnpm install formisch
README

Formisch

Formisch is a schema-based, headless form library for JS frameworks. It manages form state and validation. It is type-safe, fast by default and its bundle size is small due to its modular design. Try it out in our playground!

Supported frameworks: Preact, Qwik, React, SolidJS, Svelte and Vue.

Highlights

  • Small bundle size starting at 2.5 kB
  • Schema-based validation with Valibot
  • Type safety with autocompletion in editor
  • It's fast – DOM updates are fine-grained
  • Minimal, readable and well thought out API
  • Supports all native HTML form fields

Example

In React a form starts with the useForm hook. It initializes your form's store based on the provided Valibot schema and infers its types. Next, wrap your form in the <Form /> component. It's a thin layer around the native <form /> element that handles form validation and submission. Then, you can access the state of a field with the useField hook or the <Field /> component to connect your inputs.

import { Field, Form, useForm } from '@formisch/react';
import * as v from 'valibot';

const LoginSchema = v.object({
  email: v.pipe(v.string(), v.email()),
  password: v.pipe(v.string(), v.minLength(8)),
});

export default function LoginPage() {
  const loginForm = useForm({
    schema: LoginSchema,
  });

  return (
    <Form of={loginForm} onSubmit={(output) => console.log(output)}>
      <Field of={loginForm} path={['email']}>
        {(field) => (
          <div>
            <input {...field.props} value={field.input} type="email" />
            {field.errors && <div>{field.errors[0]}</div>}
          </div>
        )}
      </Field>
      <Field of={loginForm} path={['password']}>
        {(field) => (
          <div>
            <input {...field.props} value={field.input} type="password" />
            {field.errors && <div>{field.errors[0]}</div>}
          </div>
        )}
      </Field>
      <button type="submit">Login</button>
    </Form>
  );
}

In addition, Formisch offers several functions (we call them "methods") that can be used to read and manipulate the form state. These include focus, getDeepErrorEntries, getDeepErrors, getDirtyInput, getDirtyPaths, getErrors, getInput, handleSubmit, insert, isDirty, isEdited, isTouched, isValid, move, pickDirty, remove, replace, reset, setErrors, setInput, submit, swap and validate. These methods allow you to control the form programmatically.

Comparison

What makes Formisch unique is its framework-agnostic core, which is fully native to the framework you are using. It works by inserting framework-specific reactivity blocks when the core package is built, giving you native performance for any UI update. A modular methods API keeps bundles starting at just ~2.5 kB by only including the methods you import, and end-to-end type safety covers deeply nested paths and field arrays with TypeScript inference that stays fast even as forms grow.

Vision

My vision for Formisch is to create a framework-agnostic platform similar to Vite, but for forms — a shared core that lets the same mental model and codebase work natively across every modern UI framework.

Partners

Thanks to our partners who support the development! Join them and contribute to the sustainability of open source software!

Partners of Formisch

Feedback

Find a bug or have an idea how to improve the library? Please fill out an issue. Together we can make forms even better!

License

This project is available free of charge and licensed under the MIT license.

관련 저장소
jaredpalmer/formik

Build forms in React, without the tears 😭

TypeScriptnpmApache License 2.0reactforms
formik.org
34.3k2.8k
formbricks/formbricks

Open Source Qualtrics Alternative

TypeScriptnpmOtherformssurvey
formbricks.com
12.6k2.4k
alibaba/formily

📱🚀 🧩 Cross Device & High Performance Normal Form/Dynamic(JSON Schema) Form/Form Builder -- Support React/React Native/Vue 2/Vue 3

TypeScriptnpmMIT Licensereactjson-schema
formilyjs.org
12.6k1.6k
redux-form/redux-form

A Higher Order Component using react-redux to keep form state in a Redux store

JavaScriptnpmMIT Licensereduxredux-form
redux-form.com
12.5k1.6k
logaretm/vee-validate

✅ Painless Vue forms

TypeScriptnpmMIT Licensevuevalidation
vee-validate.logaretm.com/v4
11.3k1.3k
heyform/heyform

Open-Source Form Builder

TypeScriptnpmGNU Affero General Public License v3.0formquiz
heyform.net
8.9k688
x-extends/vxe-table

vxe table 支持 vue2, vue3 的表格解决方案

TypeScriptnpmMIT Licensevxe-tablevue
vxetable.cn
8.6k1.1k
alibaba/x-render

🚴‍♀️ Very easy to use process form table chart solution.

TypeScriptnpmjavascriptreact
xrender.fun
7.9k1.1k
final-form/react-final-form

🏁 High performance subscription-based form state management for React

JavaScriptnpmMIT Licensereactform
final-form.org/react
7.4k496
node-formidable/formidable

The most used, flexible, fast and streaming parser for multipart form data. Supports uploading to serverless environments, AWS S3, Azure, GCP or the filesystem. Used in production.

JavaScriptnpmMIT Licenseformmultipart-formdata
7.2k688
xaboy/form-create

:fire::fire::fire: 强大的低代码动态表单组件,通过JSON数据驱动表单渲染,适配移动端,支持可视化设计。提高开发者对表单的开发效率。目前在政务系统、OA系统、ERP系统、电商系统、流程管理等系统中已稳定应用。

JavaScriptnpmMIT Licenseelement-uiant-design-vue
form-create.com
7.1k1.1k
TanStack/form

🤖 Headless, performant, and type-safe form state management for TS/JS, React, Vue, Angular, Solid, and Lit.

TypeScriptnpmMIT Licensereactforms
tanstack.com/form
6.6k664