Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <!-- Bootstrap -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>

  <!-- Bento Carousel -->
  <script type="module" src="https://cdn.ampproject.org/bento.mjs" crossorigin="anonymous"></script>
  <script nomodule src="https://cdn.ampproject.org/bento.js" crossorigin="anonymous"></script>
  <script type="module" src="https://cdn.ampproject.org/v0/bento-base-carousel-1.0.mjs" crossorigin="anonymous"></script>
  <script nomodule src="https://cdn.ampproject.org/v0/bento-base-carousel-1.0.js" crossorigin="anonymous"></script>
  <link rel="stylesheet" href="https://cdn.ampproject.org/v0/bento-base-carousel-1.0.css" crossorigin="anonymous">

</head>

<body>

  <bento-base-carousel id="my-carousel">
    <img height="1200" width="675" src="https://satyr.dev/1200x16:9/1" alt="" />
    <img height="1200" width="675" src="https://satyr.dev/1200x16:9/2" alt="" />
    <img height="1200" width="675" src="https://satyr.dev/1200x16:9/3" alt="" />
    <img height="1200" width="675" src="https://satyr.dev/1200x16:9/4" alt="" />
    <img height="1200" width="675" src="https://satyr.dev/1200x16:9/5" alt="" />
  </bento-base-carousel>

  <div class="container">

    <h1>Testing carousel without hints</h1>

    <p>
      Lorem ipsum dolor, sit amet consectetur adipisicing elit. Earum repellendus, alias quam esse obcaecati reprehenderit possimus impedit error delectus tempora quod, eveniet dolore molestias maxime porro? Sunt, doloremque vitae. Porro.
    </p>

    <p>
      Lorem ipsum, dolor sit amet consectetur adipisicing elit. Molestiae voluptatibus nam, optio sint soluta nulla temporibus nihil ratione! Maiores consequuntur ipsa eos et rem in, cupiditate magnam aspernatur velit eligendi.
    </p>

  </div>

</body>
              
            
!

CSS

              
                body {
  margin: 0;
}

.container {
  padding: 3rem;
}

bento-base-carousel {
  height: 56.25vh;
  width: 100vw;
}

bento-base-carousel > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

              
            
!

JS

              
                (async () => {
  const carousel = document.querySelector("#my-carousel");
  await customElements.whenDefined("bento-base-carousel");
  const api = await carousel.getApi();
  // programatically advance to next slide
  api.next();
})();

              
            
!
999px

Console