Picture element
Hi, hi you all solve the problem of responsive images ? (We have to change images, because of the content of the image should change on smaller devices, so the focus is smaller)
Read full answer below ↓Question
Hi, I would like to add a "picture" block to the editor, where we could define differnt image for different device, the base html for that would look like so:
<picture>
<source data-gjs-type="source" media="(min-width: 650px)" srcset="">
<source data-gjs-type="source" media="(min-width: 465px)" srcset="">
<img src="">
</picture>
My problem is, wen it is inserted to the editor, the img component, is viisble, and moveable, even from the picture element. With that it could be cause unintended layout problems, and the images could end up in different place. Another issue with this, that the amount of sources could be changing by usage, sometimes, it is only 1 source (device support) reuired sometimes, 3...
What would be the best way to overcome these problem?
Answers (2)
Hi, hi you all solve the problem of responsive images ? (We have to change images, because of the content of the image should change on smaller devices, so the focus is smaller)
Learn how to create custom Components and then take a look at all the available properties on the Component (so you can tell, for example, the image not being draggable)
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3218
How to add new HTML element with inline styles?
I would like to add a new HTML element, with inline styles, around the rte.selection(). With the following example, the HTML is OK, but pro...
Issue #2381
[QUESTION] Is it possible to add info modal on the editor
Hi, I would like to add on the grapejs editor a clickable questionmark we can click so we could give information on what does this specific...
Issue #3339
Question: How to add different aspect ratios to mobile devices in the device manager.
We are working on a cms system that uses grapes js. We came up with a condition where we couldn't add aspect ratio in the "mediaCondition"...
Issue #2595
[Question] Having trouble dragging external html with draggable="true"
I want to make an external html element able to be dragged into GrapesJS, like how you can drag in a block and it will add something. I hav...
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
GrapesJS vs Webflow vs Tilda (2026): Honest Comparison, Pricing & Which to Pick
GrapesJS vs Webflow vs Tilda compared head-to-head: real 2026 pricing, SEO features, code export, and which one actually fits your project
Tutorial
GrapesJS and AI: The Future of No-Code Web Design
GrapesJS, a popular drag-and-drop web builder framework, is now getting an AI-powered makeover
Tutorial
GrapesJS vs Gutenberg: How to Build a Custom WordPress Page Builder
Compare GrapesJS and Gutenberg, learn when to use each, and follow a step-by-step guide to build a production WordPress page builder with GrapesJS.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.