</> ConvertAtlas Developer Tools
Bootstrap 5 · Intermediate

Custom Image Carousel

A custom carousel with prev/next and clickable dot indicators.

Requires Bootstrap 5. Add the CDN tags below to your page (styles in <head>, scripts before </body>). The downloaded file already includes them.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<div class="card border-0 shadow-sm overflow-hidden" style="max-width:320px">
  <div style="height:180px;position:relative" id="carStage">
    <div class="w-100 h-100 position-absolute" style="background:linear-gradient(135deg,#ff7a18,#ff477e)"></div>
  </div>
  <div class="card-body d-flex justify-content-between align-items-center py-2">
    <button class="btn btn-sm btn-light" id="carPrev">‹</button>
    <div class="d-flex gap-1" id="carDots"></div>
    <button class="btn btn-sm btn-light" id="carNext">›</button>
  </div>
</div>
var grads=['linear-gradient(135deg,#ff7a18,#ff477e)','linear-gradient(135deg,#5b6cff,#00d4ff)','linear-gradient(135deg,#16a34a,#a3e635)'];
var stage=document.getElementById('carStage').firstElementChild,dots=document.getElementById('carDots'),i=0;
grads.forEach(function(g,k){var d=document.createElement('span');d.style.cssText='width:8px;height:8px;border-radius:50%;background:'+(k===0?'#0d6efd':'#ccc');dots.appendChild(d)});
function show(n){i=(n+grads.length)%grads.length;stage.style.background=grads[i];[].forEach.call(dots.children,function(d,k){d.style.background=k===i?'#0d6efd':'#ccc'})}
document.getElementById('carPrev').onclick=function(){show(i-1)};
document.getElementById('carNext').onclick=function(){show(i+1)};
Free to use.This component uses Bootstrap 5 (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.