Issue #3409✓ SolvedOpened Apr 21, 2021by ltenti-eventboost3 reactions

Custom component property that is not a trait

Quick answerby ltenti-eventboost2

Thank you both!

Read full answer below ↓

Question

I would like to create a custom component with a property that will be updated by specific code, but I don't want this property to be visible and updatable as a trait; let say my property is called "ebTesto", I wrote a plugin function like that: I expected to find my new property in the "gjs-components" part of the stored JSON, but this is what I got: Maybe I'm trying the wrong way? Has anyone ever had a similar need? Thanks for your help!

Answers (4)

👍 Most helpfulltenti-eventboostApr 23, 2021

Thank you both!

Ju99ernautApr 22, 2021

I think it's not stored since the property hasn't been changed from the default. The editor should be able to recover the property from the component definition itself.

Ju99ernautApr 22, 2021

Try adding it inside defaults

GJSBlockMay 17, 2026

Thanks for reporting this, @ltenti-eventboost. Great question about [QUESTION] Custom component property that is not a trait. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listen...

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 →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.