vue-formify
Build powerful, type-safe forms in Vue.
VueFormify is a form-building library for Vue that simplifies creating both simple and complex forms. It offers type safety, schema validations and a minimal bundle size (~4kb gzipped), making it both secure and efficient.
Features
- Type Safe: Ensures accurate data types and autocompletion across fields.
- Validation: Use schema based validators like
Zod,ValibotorArkType. - Auto Collect Values: Seamlessly gathers form data.
- Supports Nested Objects and Arrays: Easily handle complex data structures.
- Easy Third-Party Integrations: Flexible to work with other libraries.
- Customizable Components: Easily build and integrate custom components.
- Lightweight: Small footprint for a faster, more responsive app.
📚 Documentation
Read more in the documentation
📦 Install
npm i vue-formify
💻 Usage
Basic
<script lang="ts" setup>
import { useForm } from 'vue-formify';
type FormData = {
email: string;
}
const {
Form,
Field,
Error,
handleSubmit,
} = useForm<FormData>();
const sendForm = handleSubmit((data) => {
console.log(data)
})
</script>
<template>
<Form @submit="sendForm">
<Field name="email" />
<Error error-for="email" />
<button>Send</button>
</Form>
</template>
ArkType example
<script lang="ts" setup>
import { type } from 'arktype';
import { useForm } from 'vue-formify';
const { Form, Field, handleSubmit } = useForm({
schema: type({
first_name: 'string >= 1';
last_name: 'string >= 1';
})
});
const sendForm = handleSubmit((data) => {
console.log(data);
});
</script>
<template>
<Form @submit="sendForm">
<Field name="first_name" />
<Field name="last_name" />
<button>Submit</button>
</Form>
</template>
Related Packages
@retailcrm/vue-formulario
Vue Formulario is a library, inspired by Vue Formulate , that handles the core l...
86,689
3
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 3.0.1 | ^3 | MIT | |
| 3.0.0 | ^3 | MIT | |
| 2.1.6 | ^3 | MIT | |
| 2.1.5 | ^3 | MIT | |
| 2.1.4 | ^3 | MIT | |
| 2.1.3 | ^3 | MIT | |
| 2.1.2 | ^3 | MIT | |
| 2.1.1 | ^3 | MIT | |
| 2.1.0 | ^3 | MIT | |
| 2.0.11 | ^3 | MIT | |
| 2.0.10 | ^3 | MIT | |
| 2.0.9 | ^3 | MIT | |
| 2.0.8 | ^3 | MIT | |
| 2.0.7 | ^3 | MIT | |
| 2.0.6 | ^3 | MIT | |
| 2.0.5 | ^3 | MIT | |
| 2.0.4 | ^3 | MIT | |
| 2.0.3 | ^3 | MIT | |
| 2.0.2 | ^3 | MIT | |
| 2.0.1 | ^3 | MIT | |
| 2.0.0 | ^3 | MIT | |
| 1.5.0 | ^3 | MIT | |
| 1.4.0 | ^3 | MIT | |
| 1.3.2 | ^3 | MIT | |
| 1.3.1 | ^3 | MIT | |
| 1.3.0 | ^3 | MIT | |
| 1.2.8 | ^3 | MIT | |
| 1.2.7 | ^3 | MIT | |
| 1.2.6 | ^3 | MIT | |
| 1.2.5 | ^3 | MIT |
Showing the latest 30 of 97. See every release on npm
Pre-releases (2)
| Version | Released | Vue | License |
|---|---|---|---|
| 2.0.0-1 | ^3 | MIT | |
| 2.0.0-0 | ^3 | MIT |