Issue #3662💬 AnsweredOpened August 2, 2021by aliibrahim1231 reactions

Style manager text type

快速解答by artf1

@aliibrahim123 if you don't specify any type, a simple text type property will be created :)

Read full answer below ↓

Question

grapesjs style manager has so many nice features, but it does not have a text property type, so why do not add it

Answers (3)

artfAugust 2, 2021

@aliibrahim123 if you don't specify any type, a simple text type property will be created :)

aliibrahim123August 2, 2021
代码片段TEXT
hallo
i made a simple text proporty type
this is the code

styleManager.addType('text', {
   create({ props, change }) {
     const el = document.createElement('div');
     el.innerHTML = '<input type="text" class="my-input" />';
     const inputEl = el.querySelector('.my-input');
     inputEl.addEventListener('change', event => change({ event })); // change will trigger the emit
     inputEl.addEventListener('input', event => change({ event, complete: false }));
     return el;
   },
   emit({ props, updateStyle }, { event, complete }) {
     const { value } = event.target;
     const valueRes = value;
     
     updateStyle(valueRes, { complete });
   },
   update({ value, el }) {
     el.querySelector('.my-input').value = value;
   },
   destroy() {
    
   }
});
ClaudeCodeMay 17, 2026

Thanks for reporting this, @aliibrahim123.

Great suggestion about FEAT: style manager text type! While this specific feature isn't yet in the core API, there are several ways to achieve similar behavior.

Using the event system:

editor.on('component:update', (component) => {
  // your logic here
});

Alternative approaches:

  • Listen to selector:add for CSS selector changes
  • Use selector:custom for custom rules
  • Tap into the change:* events for fine-grained tracking
  • Build a plugin that extends the editor with this capability

Making it official: If this feature would benefit many users, consider opening a formal Feature Request on the GrapesJS repo with:

  • A detailed use case
  • Code example showing the desired behavior
  • Why this matters for your workflow

The core team is receptive to well-motivated feature requests backed by real use cases.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.