The Neanic Forms library
Neanic Forms is a powerful TypeScript library for building and managing forms with Vue.js. It provides a flexible and extensible architecture for handling form state, validation, and rendering.
- Easy form state management with Vue reactivity
- Extensible validation logic with both synchronous and asynchronous support
- Customizable form element rendering to fit various UI frameworks
- Seamless integration with Vue.js components and reactivity system
To install Neanic Forms, use npm or yarn:
``bash`
npm install @neanic/formsor
yarn add @neanic/forms
Here's a basic example of how to use Neanic Forms to create a simple form:
`typescript
import { Form, Val } from "@neanic/forms";
// Define your form structure
const form = Form.object({
firstName: Form.string([Val.isRequired]),
lastName: Form.string(),
age: Form.number(),
});
`
Neanic Forms offers a variety of form-related classes and utilities. Here is a quick overview:
- Form: The main factory for creating form controls.FormObject
- , FormArray, FormString, FormNumber, FormBoolean: Classes representing different types of form entries.Val
- : A collection of standard validators.formDefaultsForVue`: A utility to set default templates for rendering Vue components based on form entry types.
-
This project is licensed under the ISC License – see the LICENSE file for details.
Developed by Neanic.