Basic Popover

Display a simple popover with a title and content.

Preview

Code

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

<div class="container py-5">

<button class="btn btn-primary"
data-bs-toggle="popover"
title="Popover Title"
data-bs-content="This is a basic Bootstrap popover.">

Click Me

</button>

</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>

<script>
document.querySelectorAll("[data-bs-toggle='popover']").forEach(function(el){
new bootstrap.Popover(el)
})
</script>

</body>
</html>

More BS5 Popover Examples (7)