editorjs-form-builder
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

Form Builder

Model

Installation

Install via NPM or Yarn

Get the package

npm i --save editorjs-form-builder

or

yarn add editorjs-form-builder

Include module in your application

import FormBuilder from "editorjs-form-builder";
const onChange = (data) => {
  console.log(data); // 
};

const initialData = [
    {
        "id": "8Z7TsKEv7e",
        "type": "textQuestion",
        "data": {
            "label": "First Name",
            "help": "",
            "placeholder": "Eg Uche",
            "required": true
        }
    },
    {
        "id": "pCtsEP685y",
        "type": "multipleChoiceQuestion",
        "data": {
            "label": "Countries",
            "help": "",
            "required": false,
            "multipleChoice": false,
            "options": [
                {
                    "id": "d077745e-7cb3-4aaa-a9f6-bd8f60f5578a",
                    "label": "Niger"
                },
                {
                    "id": "722c49bb-1a03-4ae8-b332-2a84c1bcb112",
                    "label": "Ghana"
                },
                {
                    "id": "874a231a-300e-4035-b435-234b502e7523",
                    "label": "Liberia"
                }
            ]
        }
    },
    {
        "id": "7ZcdGLmOCO",
        "type": "emailQuestion",
        "data": {
            "label": "Email",
            "help": "",
            "placeholder": "your email",
            "required": true
        }
    },
    {
        "id": "hcuBk3QFKb",
        "type": "numberQuestion",
        "data": {
            "label": "Age",
            "help": "",
            "placeholder": "",
            "required": true
        }
    }
]

return <FormBuilder onChange={onChange} initialData={initialData} />;

Package Sidebar

Install

npm i editorjs-form-builder

Weekly Downloads

1

Version

0.2.3

License

MIT

Unpacked Size

1.21 MB

Total Files

57

Last publish

Collaborators

  • ezehuche