Skip to content
Discussion options

You must be logged in to vote

Yes — you can replace the default Spectrum color picker in GrapesJS with a fully custom solution (including a React-based one), but it’s not plug-and-play. You need to override how the Style Manager handles color inputs.


🔧 Option 1 — Override the default color picker

GrapesJS uses its internal Spectrum-based picker, but you can override its view like this:

editor.on('load', () => {
  const sm = editor.StyleManager;
  const colorType = sm.getBuiltIn('color');

  colorType.view = {
    ...colorType.view,

    onRender() {
      const el = this.el;

      // Clear default UI
      el.innerHTML = '';

      // Create mount point
      const container = document.createElement('div');
      el.a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mdmontesinos
Comment options

Answer selected by mdmontesinos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants