Skip to content

A form builder library that simplifies creating, validating, and handling dynamic forms with minimal code and maximum flexibility.

License

Notifications You must be signed in to change notification settings

opengisinfo/form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Form

A lightweight library for building flexible, accessible web forms.

Documentation

Complete documentation and examples available at https://form.opengis.info

Changelog

Full change log available at https://form.opengis.info/changelog/

Install & Usage

1. Install

npm install @opengis/form

2. Usage

<template>
  <VsForm
    v-model:form="form"    
    :schema="schema"
    @handle-submit="handleSubmit"
  />
</template>

<script setup>
  import { ref } from 'vue';
  import { VsForm } from "@opengis/form";
  
  const form = ref({});
  const formValues = ref({});

  const schema = [
    {
      name: 'name',
      type: 'text',
      label: 'Full Name',
      placeholder: 'Enter your full name',
      rules: ['required'],
    },
    {
      name: 'email',
      type: 'text',
      label: 'Email',
      placeholder: 'Enter your email',
      rules: ['required', 'email'],
    },
    {
      name: 'country',
      type: 'select',
      label: 'Country',
      options: [
        { id: 'ua', text: 'Ukraine' },
        { id: 'us', text: 'United States' },
      ],
      rules: ['required'],
    },
  ];

  const handleSubmit = values => {
    console.log('Form submitted:', values);
  };
</script>

Contributions

We welcome contributions! Feel free to open issues, suggest features, or submit pull requests.

Licence

MIT

About

A form builder library that simplifies creating, validating, and handling dynamic forms with minimal code and maximum flexibility.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published