This plugin adds some basic form components and blocks to help working with forms easier
New components:
form
input
textarea
select
checkbox
radio
button
label
blocksWhich blocks to add, default:['form', 'input', 'textarea', 'select', 'button', 'label', 'checkbox', 'radio'](all),labelTraitMethodMethod trait label, default: 'Method',labelTraitActionAction trait label, default: 'Action',labelTraitStateState trait label, default: 'State',labelTraitIdID trait label, default: 'ID',labelTraitForFor trait label, default: 'For',labelInputNameInput name label, default: 'Input',labelTextareaNameTextarea name label, default: 'Textarea',labelSelectNameSelect name label, default: 'Select',labelCheckboxNameCheckbox name label, default: 'Checkbox',labelRadioNameRadio name label, default: 'Radio',labelButtonNameButton name label, default: 'Button',labelTraitNameName trait label, default: 'Name',labelTraitPlaceholderPlaceholder trait label, default: 'Placeholder',labelTraitValueValue trait label, default: 'Value',labelTraitRequiredRequired trait label, default: 'Required',labelTraitTypeType trait label, default: 'Type',labelTraitOptionsOptions trait label, default: 'Options',labelTraitCheckedChecked trait label, default: 'Checked',labelTypeTextText type label, default: 'Text',labelTypeEmailEmail type label, default: 'Email',labelTypePasswordPassword type label, default: 'Password',labelTypeNumberNumber type label, default: 'Number',labelTypeSubmitSubmit type label, default: 'Submit',labelTypeResetReset type label, default: 'Reset',labelTypeButtonButton type label, default: 'Button',labelNameLabelLabel type label, default: 'Label',labelFormForm type label, default: 'Form',labelSelectOptionSelect option type label, default: '- Select option -',labelOptionOption label, default: 'Option'
npm i grapesjs-plugin-formsoryarn add grapesjs-plugin-forms
<link href="path/to/grapes.min.css" rel="stylesheet"/>
<script src="path/to/grapes.min.js"></script>
<script src="path/to/grapesjs-plugin-forms.min.js"></script>
<div id="gjs"></div>
<script type="text/javascript">
var editor = grapesjs.init({
fromElement: 1,
container : '#gjs',
plugins: ['gjs-plugin-forms'],
pluginsOpts: {
'gjs-plugin-forms': {/* ...options */}
}
});
</script>Clone the repository
$ git clone https://github.com/artf/grapesjs-plugin-forms.git
$ cd grapesjs-plugin-formsInstall it
$ npm iStart the dev server
$ npm startBuild before the commit. This will also increase the patch level version of the package
$ npm run buildBSD 3-Clause