@devlsh/form

Lightweight, type-safe forms for Vue.
172 25
Install
npm install @devlsh/form
Latest Version:2.0.1
Vue:3
License:MIT
Last Updated:Oct 24, 2026
Links: GitHub  ·  npm
Maintainer: devlsh

@devlsh/form

Lightweight, type-safe forms for Vue.


NPM Downloads GitHub Stars Build Status Software License


  • Interactive demo.
  • Typed field names and values.
  • Reactive field values and validation errors.
  • Field validation with async-validator rules.
  • Async submit callbacks with a loading state.
  • Default values, form reset, and manual field errors.

Installation

$ npm install @devlsh/form

Usage

Validate an email field before submission.

<template>
  <form novalidate @submit="submit">
    <label for="email">Email Address</label>
    <input
      id="email"
      name="email"
      type="email"
      autocomplete="email"
      required
      :disabled="loading"
      :aria-invalid="email.hasError"
      :aria-describedby="email.hasError ? 'email-error' : undefined"
      v-model="email.value"
    />

    <p id="email-error" role="alert" v-if="email.hasError">{{ email.error?.message }}</p>

    <button type="submit" :disabled="loading">Submit</button>
  </form>
</template>

<script setup lang="ts">
  import { useForm } from '@devlsh/form';

  interface MyForm {
    email: string;
  }

  const { useField, handle, loading } = useForm<MyForm>({
    defaults: { email: '' },
  });

  const email = useField('email', {
    type: 'email',
    required: true,
  });

  const submit = handle(async (values) => {
    console.log(values.email);
  });
</script>

Contributing

Report bugs through issues or ask questions in Discussions. Report vulnerabilities privately as described in SECURITY.md.

For local development, pull requests, and other contributions, see the Contributing Guidelines.

License

@devlsh/form is free and open-source software licensed under the MIT License.


devlsh.com  ·  GitHub: @devlsh  ·  X: @itsdevlsh

Related Packages

@adbros/vue-validation

Composable for schema-based form validation in Vue 3 using Valibot

6,036 0
@rc-component/async-validator

Validate form asynchronous

99,929,287 16
vue-dog-form

The simplest vue 3 form validation plugin.

65,599 8
vue-form-2

Vue.js 2 form component

16,113 55
@vuetils/form

Tiny form validation library for Vue

10,354 3

Version History

Version Released Vue License
2.0.1 ^3.0.0 MIT
2.0.0 ^3.0.0 MIT
1.1.0 ^3.3.8 GPL-3.0-only