Adding multiple text type traits
Got the solution. we need to extend type text in traits. Thankyou. editor.DomComponents.addType('paraJustify', { isComponent: el => ((el.attributes && el.attributes.paraJustify && el.attributes.paraJustify.value)), extend: 'text', model: { defaults: { traits: [ { type: 'select', options: [ { value: 'text-align:center'...
Read full answer below βQuestion
Whenever i am trying to add multiple traits of type text with all different conditions and on different tags/attributes but it will take only last one at every traits conditions. Please help me out with the solution. Below is the code editor.DomComponents.addType('text', { isComponent: el =>( (el.attributes&&el.attributes.paraJustify&&el.attributes.paraJustify.value) ), model: { defaults: { traits: [ { type: 'select', options: [ { value: 'text-align:center', name: 'Center' }, { value: 'text-align:left ', name: 'Left' }, { value: 'text-align:right', name: 'Right' }, { value: 'text-align:justif...
Answers (1)
Got the solution. we need to extend type text in traits. Thankyou. editor.DomComponents.addType('paraJustify', { isComponent: el => ((el.attributes && el.attributes.paraJustify && el.attributes.paraJustify.value)), extend: 'text', model: { defaults: { traits: [ { type: 'select', options: [ { value:...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2785
Adding multiple text type traits.
Whenever i am trying to add multiple traits of type text with all different conditions and on different tags but it will take only last one...
Issue #3136
Create one more key in JSON
{ "type": "text", "status": "hovered", "content": "Insert your text here", "attributes": { "id": "ixx2" }, "activeOnRender": 0, "open": fal...
Issue #3732
Comment component type do not support adding traits
i am working on a script that add a trait on all the component type , but the comment type do not have the prototype object. code
Issue #1002
Please help me in integrating grapesjs with graphQL
Hi Guys, Can you help me out on how to query urlStore, urlLoad instead of using rest api call, we need to use graphQL. In GraphQL we will h...
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.
Tutorial
Vanilla GrapesJS vs GrapesJS With Plugins: What You Actually Get Out of the Box (2026)
New to GrapesJS? See exactly what the stock editor gives you, where it falls short, and which plugins close the gaps β a beginner-friendly 2026 comparison
Tutorial
Lighthouse for GrapesJS: Audit Accessibility and SEO Without Leaving the Editor
Live WCAG 2.1/2.2 accessibility auditor + SEO manager for GrapesJS. Every finding is bound to the exact component β click to select, then one-click fix.
Tutorial
GrapesJS DevTools: A Developer Panel Inside Your Editor
If you've ever debugged GrapesJS with console.log(editor.getSelected()) and a dozen throwaway event listeners β this post is for you.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.