formvuelate

Schema Form Generator

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
formvuelate
445323.9.12 years ago4 years agoMinified + gzip package size for formvuelate in KB

Readme

FormVueLate
FormVueLate Logo
FormVueLate NPM codecov Buy us a tree
Visit FormVueLate 3.0's full documentation for more detailed information and examples.

Getting Started

FormVueLate is a zero dependency library that allows you to generate schema-driven forms with extreme ease.
The schema that you use for your form can be as flexible as you need it to be, it can be modified at run-time with an expected reactive result, and can even be fetched directly from you backend’s API.
Important
FormVueLate is a bring-your-own-components library!
We do not provide any base components for your to build your forms. There are numerous component libraries out there that do a great job of providing carefully constructed components for you to use, and FormVueLate does a great job at allowing you to bring those external components to your forms, or even crafting your own.

Installation

To add FormVueLate to your project, start by installing the package through your favorite package manager.
yarn add formvuelate
// OR
npm install formvuelate

Using the SchemaForm component

Now that you have the package in your project, import it to your component.
import { SchemaForm, useSchemaForm } from 'formvuelate'

The SchemaForm requires one prop, schema, which is the meta-data of your form. You must also import the useSchemaForm composable which we will use in our setup function to initialize the form's model where the user's data is kept.
<template>
  <SchemaForm :schema="mySchema" />
</template>

<script>
import { ref } from 'vue'
import { SchemaForm, useSchemaForm } from 'formvuelate'

export default {
  components: { SchemaForm },
  setup () {
    const formModel = ref({})
    useSchemaForm(formModel)

    const mySchema = ref({
      // Schema here
    })

    return {
      mySchema
    }
  }
}
</script>

SchemaForm will automatically update the state within your formModel when your components update.

Official plugins

Lookup Plugin

A mapping and replacement plugin to parse complex schemas into FormVueLate ready structure.

Vee-Validate Plugin

Easily incporate Vee-Validate powered validations into your forms.

Vuelidate Plugin WIP

Easily incorporate Vuelidate powered validations into your forms.

Core team

<td align="center">
  <a href="https://github.com/marina-mosti">
    <img src="https://avatars2.githubusercontent.com/u/14843771?s=460&u=1d11d62c22d38c01d73e6c92587bd567f4e51d27&v=4" width="120px;" alt="Marina Mosti"/>
    <br />
    <sub><b>Marina Mosti</b></sub>
  </a>
</td>
<td align="center">
  <a href="https://github.com/logaretm">
    <img src="https://avatars.githubusercontent.com/u/6261322?v=4" width="120px;" alt="Abdelrahman Awad"/>
    <br />
    <sub><b>Abdelrahman Awad</b></sub>
  </a>
</td>

Emeriti

Special thanks to these folks which have provided invaluable contributions to the project.

Licence

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.