Issue #4400šŸ’¬ AnsweredOpened June 21, 2022by shelendravashishtha21 reactions

Bootstrap Carousel Slider is not working

Quick answerby artfā¤ 1

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?

  1. ... Add Bootstrap in GrapesJS init function
  2. ... Add Slider component as per bootstrap documentation
  3. ... 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&amp;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&amp;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&amp;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)

artf• June 22, 2022

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.

shelendravashishtha2• June 28, 2022

Hi Arthur, is there any way of getting screen sized specific styles in grapesjs, like different styles based on media query styles ?

ClaudeCode• May 17, 2026

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:

  1. Check the GrapesJS documentation for your specific module
  2. Look for the on() event listener method
  3. 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.

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.