Bootstrap Carousel Slider is not working
Sorry but the issue tracker is mainly for bugs in the core grapesjs module and I believe in this case you should instantiate the bootstrap.Carousel manually via JS (eg. by creating a custom component with JS) as the editor has to load canvas-related styles/scripts before the content.
Read full answer below āQuestion
GrapesJS version
- I confirm to use the latest version of GrapesJS
What browser are you using?
Chrome
Reproducible demo link
NO LINK
Describe the bug
How to reproduce the bug?
- ... Add Bootstrap in GrapesJS init function
- ... Add Slider component as per bootstrap documentation
- ... Slider shows only first image and image doesn't change
What is the expected behavior? ... Slider should start with first image and animate till the last image
What is the current behavior? ... Slider shows just first active image and then nothing happens at all
If is necessary to execute some code in order to reproduce the bug, paste it here below:
The HTML I am using is
<div data-gjs-highlightable="true" id="c7551f9a8-7324-4f9b-ba04-2f4e90522b1c" data-gjs-type="default" draggable="true" class="carousel slide" data-bs-ride="carousel">
<div data-gjs-highlightable="true" id="irrxo5" data-gjs-type="default" draggable="true" class="carousel-inner">
<div data-gjs-highlightable="true" id="c171d86b1-5615-42a4-9898-d7fdf7c761bb" data-gjs-type="default" draggable="true" class="carousel-item active" data-bs-interval="1000">
<img id="c0b9d1877-e6db-4b41-9123-c86d9454364c" data-gjs-type="image" draggable="true" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRM4o1hlPBfAyhlk2oHiCbo3wz6V7RI4yrljw&usqp=CAU" class="">
</div>
<div data-gjs-highlightable="true" id="c935920c3-d162-46e3-b686-35b713c95182" data-gjs-type="default" draggable="true" class="carousel-item" data-bs-interval="1000">
<img id="c6c94de87-956f-4342-8b01-6053420b69ae" data-gjs-type="image" draggable="true" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRznJFvfPb8GZeayLxLLEe4mP5_L5OUObiCOA&usqp=CAU">
</div>
<div data-gjs-highlightable="true" id="cfe03d6ab-5361-4c19-a16b-68f315948790" data-gjs-type="default" draggable="true" class="carousel-item" data-bs-interval="1000">
<img id="c41e0f231-c54c-4d6a-9421-2ae7463828ff" data-gjs-type="image" draggable="true" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTZV7qZYQn_wD0VqfJKxolmB0OSj_zRH-wznw&usqp=CAU">
</div>
</div>
</div>
This is Grapes JS init function
grapesjs.init({
container: "#gjs",
fromElement: true,
plugins: ["gjs-preset-newsletter", "grapesjs-lory-slider"],
pluginsOpts: {
"gjs-preset-newsletter": {
modalTitleImport: "Import template",
},
"grapesjs-lory-slider": {},
},
canvas: {
styles: [
"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css",
],
scripts: [
"https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js",
],
},
storageManager: false,
});
Code of Conduct
- I agree to follow this project's Code of Conduct
Answers (3)
Sorry but the issue tracker is mainly for bugs in the core grapesjs module and I believe in this case you should instantiate the bootstrap.Carousel manually via JS (eg. by creating a custom component with JS) as the editor has to load canvas-related styles/scripts before the content.
Hi Arthur, is there any way of getting screen sized specific styles in grapesjs, like different styles based on media query styles ?
Thanks for reporting this, @shelendravashishtha2.
Great question about Bootstrap Carousel Slider is not working. The recommended approach with StyleManager is to use the event-driven API.
Start here:
- Check the GrapesJS documentation for your specific module
- Look for the
on()event listener method - Most operations can be achieved by listening to editor and component events
Common patterns:
// Listen for changes
editor.on('change', () => console.log('something changed'));
// Component lifecycle
editor.on('component:mount', (c) => console.log('component ready', c));
editor.on('component:update', (c) => console.log('component updated', c));
If you're still stuck:
- Share a minimal CodeSandbox reproduction
- Include what you've already tried
- Mention your GrapesJS version
- The community is here to help!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #5173
editor.Css.setRule API not working as expected, it is not updating the rule existing rule.
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Version 112.0.5615.137 (Official Build) (a...
Issue #6458
sector.setName doesn't work
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://jsfi...
Issue #5460
Loading `component` and `styles` from `pageManager`
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome v117.0.5938.149Reproducible demo link...
Issue #3832
The css classes are removed and the autogenerated ids for each html tags gets changed ( Example : ivj5m-2) after each reload
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link Not there De...
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
Big Updates: TinyMCE 8 and Placeholder 2.0 for GrapesJS
In May we shipped major updates to two of our most popular GrapesJS plugins ā TinyMCE Inline Text Editor and Placeholder.
Tutorial
Find the Right GrapesJS Plugin in Seconds: Smarter Discovery Is Live
We're shipping a set of discovery upgrades. New label filters, a proper compatibility switch for GrapesJS vs Studio, one-click and a smarter sort bar.
Tutorial
GrapesJS vs Webflow vs Tilda: What to Choose for Your Business in 2026
Choosing the right website platform in 2026 is no longer just about building a site
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.