PageKit — the self-hosted GrapesJS site builder, sold as source. Get early access

Grapesjs Component Code Editor
1 images

Grapesjs Component Code Editor

Free
GrapesJS:0.18.x0.19.x0.20.x0.21.x
Download from GitHub

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.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

The stock GrapesJS code view shows the whole document. This plugin scopes it: select a component and its own HTML and CSS open in the right-hand panel, editable, with changes applied back to that component alone.

Commands

  • open-code — opens the editor in the side panel. Wire it to a panel button in your editor config.
  • code-editor-object and code-editor-constructor — reach the CodeEditor instance or its constructor from your own code.

Layout options

openState and closedState set how the panel and canvas split — 35/65 when open and 15/85 when closed by default. preserveWidth stops the resizing entirely, and appendTo or panelId place the editor somewhere other than the default views container.

The selector problem it solves

Deleting a CSS rule in a code editor does not remove the selector from the GrapesJS Selector Manager, so the rule keeps affecting the component after saving. cleanCssBtn, on by default, adds a button that removes the selector from both places. It applies to valid CSS rules.

Recommended pairing

The author recommends using grapesjs-parser-postcss alongside this plugin: the default CSS parser is inconsistent and adds a lot of extra rules, which becomes visible as soon as you read your own CSS back.

Ratings:

No reviews yet. Be the first to share your experience.


Share this item:
Last Update:Sep 8, 2026
Published:Jul 10, 2023
Versions:
0.18.x0.19.x0.20.x0.21.x

Questions & Answers

No questions yet. Have something to ask?