Default Component Properties
@artf FYI that doesn't exactly work as needed. Updating the default component's default properties does not take effect for already-defined components (such as built in table, textnode, et. al.) because they have already extended the default model. Updating the default component would only change the default behavior...
Read full answer below βQuestion
Is there any way I can change the default properties of components?
I want almost everything to be copyable: false, resizable: false, draggable: false unless the loaded component specifically provides a data-resizable=true.
So basically I want to whitelist some components to enable these instead of blacklisting.
Is it doable?
Answers (3)
@artf FYI that doesn't exactly work as needed. Updating the default component's default properties does not take effect for already-defined components (such as built in table, textnode, et. al.) because they have already extended the default model. Updating the default component would only change t...
You can update the default component https://grapesjs.com/docs/modules/Components.html#update-component-type
@jereddanielson correct, this is how you should do to update also already defined component types. Thanks for pointing this out
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1336
[Question] Can I make everything unselectable by default?
Currently all components are selectable/hoverable by default. And if you want you can change that behavior by providing data-gjs-hoverable=...
Issue #865
[QUESTION] How can I set default tagName
Hi ! I want to set tagName tr for all components(or specific component in use). Is there any predefined function to set tagName ?
Issue #1191
Is there a way to find the number of components
I want to remove the component start from the secondοΌso i need to take the traversal. domc.getComponents() is getting everything.i just wan...
Issue #1841
Components name
I have two questions.Is there any way to change the built-in components name? I wanted to change the name "Box" to "Div". so the same name...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins β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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.