Grapesjs Script Editor
What's Included
- Free to download & use
- Open for personal & commercial use
Support The Creator
Use one-time or monthly support to thank the creator for this free product.
GrapesJS Compatible
Tested with GrapesJS 0.17.x, 0.18.x, 0.19.x, 0.20.x, 0.21.x
Open Source on GitHub
Free to use, fork, and contribute
Editor Compatible
Designed for the GrapesJS open-source editor
Free to Use
Open for personal and commercial projects
GrapesJS components can carry their own scripts, but there is no interface for writing one. This plugin adds it: select a component, open the script modal from its toolbar, and the code you write is bound to that element.
What it adds
An edit-script command and a component toolbar button that opens it. Scripts live on the component, so duplicating or moving the element carries its behaviour along with it.
Options
starter— the code the editor opens with. Defaults tolet el = this, the reference to the component the script belongs to.scriptTypesSupport— component types allowed to have scripts attached:default,wrapper,text,textnode,image,videoandsvgby default. Keep components that already define their own scripts out of this list.onRun— runs when the syntax check passes.onError— receives the error when it does not, so you can surface it in your own interface.modalTitle,buttonLabelandtoolbarIcon— the modal heading, save button label and toolbar icon.codeViewOptions— options for the underlying code viewer.commandAttachScript— extend the command itself.
Good to know
Register the plugin after your other components. Install as grapesjs-script-editor.
Ratings:
No reviews yet. Be the first to share your experience.
Questions & Answers
No questions yet. Have something to ask?
Common problems this plugin can help fix
Real community questions on the same topic — see how others worked around them.
