Bootstrap 5 popovers display contextual information in a floating panel with a title and body. This page covers 4 popover patterns — basic, positions, HTML content and dismissible — each with working examples.
Quick Setup
Popovers require Bootstrap 5 JS and manual initialization:
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.querySelectorAll('[data-bs-toggle="popover"]').forEach(el => {
new bootstrap.Popover(el)
})
</script>
Key Classes Reference
| Attribute | What It Does |
|---|---|
data-bs-toggle="popover" | Marks element as popover trigger |
data-bs-title | Popover title text |
data-bs-content | Popover body content |
data-bs-placement | Position: top, bottom, left, right |
data-bs-html="true" | Enables HTML in title and content |
data-bs-trigger | Trigger: click, hover, focus, manual |
data-bs-custom-class | Adds custom CSS class to popover |
1. Basic Bootstrap 5 Popovers
Popovers with title and body content triggered on click. Require JavaScript initialization.
2. Bootstrap 5 Popovers on All Sides
Popovers positioned on top, bottom, left and right using data-bs-placement.
3. Bootstrap 5 HTML Popover
Popovers with rich HTML content including lists, links and formatted text.
4. Bootstrap 5 Dismissible Popover
Popover that closes when clicking anywhere outside using focus trigger and tabindex.
Frequently Asked Questions
Need a Full Bootstrap 5 Admin Dashboard?
Get a complete Angular 21 + Bootstrap 5 dashboard with 50+ components — built by the same team behind BootstrapPlanet.
Browse Templates →Use code FIRST30 for 30% off your first purchase.