Popovers
Documentation and examples for adding Bootstrap popovers, like those found in iOS, to any element on your site.
Overview
Things to know when using the popover plugin:
- Popovers rely on the 3rd party library Popper.js for positioning. You must include popper.min.js before bootstrap.js or use
bootstrap.bundle.min.js
/bootstrap.bundle.js
which contains Popper.js in order for popovers to work! - Popovers require the tooltip plugin as a dependency.
- If you’re building our JavaScript from source, it requires
util.js
. - Popovers are opt-in for performance reasons, so you must initialize them yourself.
- Zero-length
title
andcontent
values will never show a popover. - Specify
container: 'body'
to avoid rendering problems in more complex components (like our input groups, button groups, etc). - Triggering popovers on hidden elements will not work.
- Popovers for
.disabled
ordisabled
elements must be triggered on a wrapper element. - When triggered from anchors that wrap across multiple lines, popovers will be centered between the anchors’ overall width. Use
white-space: nowrap;
on your<a>
s to avoid this behavior. - Popovers must be hidden before their corresponding elements have been removed from the DOM.
Example
Four options are available: top, right, bottom, and left aligned.
HTML Content
Place Popover HTML content anywhere within the body of your page usign .popover-content
with default display:none
. then append HTML using the id.