</> ConvertAtlas Developer Tools
Bootstrap 5 · Beginner

Show/Hide Toggle

A button that expands and collapses a details panel with an arrow.

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" style="max-width:360px"><div class="card-body">
  <button class="btn btn-light w-100 d-flex justify-content-between align-items-center" id="acBtn">Show details <span id="acIcon">▼</span></button>
  <div id="acPanel" class="mt-2 small text-secondary" style="display:none">Here are the extra details that expand and collapse when you click the button above.</div>
</div></div>
var btn=document.getElementById('acBtn'),panel=document.getElementById('acPanel'),icon=document.getElementById('acIcon');
btn.onclick=function(){var open=panel.style.display==='none';panel.style.display=open?'block':'none';icon.textContent=open?'▲':'▼'};
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.