1.0.0 • Published 3 months ago

@genform/core v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

GenForm

Core Package

Genform is a JavaScript library for creating web forms from JSON or JS. It's designed to be simple and flexible. You can create forms with just a few lines of code. It's also possible to create complex forms with lots of customization.

The Core package is the core of the library. It contains the main functions of the library.

How to use it ?

First, you need to install the package :

npm install @genform/core

Then, you can use it in your project :

// Import GenForm from the package
import genform from '@genform/core'

// Assuming you have a JSON object defining your form
const formData = {
  elems: [
    {
      type: 'text',
      name: 'username',
      placeholder: 'Enter your username',
      required: true
    }
    // Add more form elements as needed
  ],
  params: {
    action: '/submit',
    method: 'POST'
  },
  features: {}
}

// Retrieve the container element where you want to render the form
const formContainer = document.getElementById('genform')

// Create the form using GenForm
const form = genform.toForm(document, formData)

// Append the form to the container
formContainer.appendChild(form)

The json is composed of 2 parts :

  • elems : The form elements, you can have your inputs, buttons, etc.
  • params : The form parameters, you can have the action, method, etc.

Want to contribute ?

If you want to contribute to the project, you can check the GitHub repository.

License

This project is under the MIT license.

Web interface

To generate automatically a form, you can use the web interface.

1.0.0

3 months ago

0.1.38

3 months ago

0.1.39

3 months ago

0.1.36

3 months ago

0.1.37

3 months ago

0.1.30

3 months ago

0.1.31

3 months ago

0.1.32

3 months ago

0.1.33

3 months ago

0.1.34

3 months ago

0.1.35

3 months ago

0.1.27

3 months ago

0.1.28

3 months ago

0.1.29

3 months ago

0.1.20

3 months ago

0.1.21

3 months ago

0.1.22

3 months ago

0.1.23

3 months ago

0.1.24

3 months ago

0.1.25

3 months ago

0.1.26

3 months ago

0.1.19

3 months ago

0.1.18

4 months ago

0.1.16

4 months ago

0.1.17

4 months ago

0.1.15

4 months ago

0.1.14

4 months ago

0.1.13

4 months ago

0.1.12

4 months ago

0.1.10

4 months ago

0.1.11

4 months ago

0.1.8

4 months ago

0.1.7

4 months ago

0.1.9

4 months ago

0.1.6

4 months ago

0.1.4

4 months ago

0.1.5

4 months ago

0.1.1

4 months ago

0.1.0

5 months ago

0.0.11

5 months ago

0.0.12

5 months ago

0.0.10

5 months ago

0.0.9

5 months ago

0.0.8

5 months ago

0.0.5

5 months ago

0.0.7

5 months ago

0.0.6

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.4

5 months ago

0.0.1

5 months ago