animation |
boolean |
true |
Apply a CSS fade transition to the popover |
container |
string | element | false |
false |
Appends the popover to a specific element. Example: container: 'body' . This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.
|
content |
string | element | function |
'' |
Default content value if data-bs-content attribute isn't present.
If a function is given, it will be called with its this reference set to the element that the popover is attached to.
|
delay |
number | object |
0 |
Delay showing and hiding the popover (ms) - does not apply to manual trigger type
If a number is supplied, delay is applied to both hide/show
Object structure is: delay: { "show": 500, "hide": 100 }
|
html |
boolean |
false |
Insert HTML into the popover. If false, innerText property will be used to insert content into the DOM. Use text if you're worried about XSS attacks. |
placement |
string | function |
'right' |
How to position the popover - auto | top | bottom | left | right. When auto is specified, it will dynamically reorient the popover.
When a function is used to determine the placement, it is called with the popover DOM node as its first argument and the triggering element DOM node as its second. The this context is set to the popover instance.
|
selector |
string | false |
false |
If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See this and an informative example. |
template |
string |
'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>' |
Base HTML to use when creating the popover.
The popover's title will be injected into the .popover-header .
The popover's content will be injected into the .popover-body .
.popover-arrow will become the popover's arrow.
The outermost wrapper element should have the .popover class.
|
title |
string | element | function |
'' |
Default title value if title attribute isn't present.
If a function is given, it will be called with its this reference set to the element that the popover is attached to.
|
trigger |
string |
'click' |
How popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space. manual cannot be combined with any other trigger. |
fallbackPlacements |
string | array |
'flip' |
Allow to specify which position Popper will use on fallback. For more information refer to
Popper's behavior docs |
boundary |
string | element |
'scrollParent' |
Overflow constraint boundary of the popover. Accepts the values of 'viewport' , 'window' , 'scrollParent' , or an HTMLElement reference (JavaScript only). For more information refer to Popper's preventOverflow docs. |
customClass |
string | function |
'' |
Add classes to the popover when it is shown. Note that these classes will be added in addition to any classes specified in the template. To add multiple classes, separate them with spaces: 'class-1 class-2' .
You can also pass a function that should return a single string containing additional class names.
|
sanitize |
boolean |
true |
Enable or disable the sanitization. If activated 'template' , 'content' and 'title' options will be sanitized. See the }}">sanitizer section in our JavaScript documentation. |
allowList |
object |
}}">Default value |
Object which contains allowed attributes and tags |
sanitizeFn |
null | function |
null |
Here you can supply your own sanitize function. This can be useful if you prefer to use a dedicated library to perform sanitization. |
popperConfig |
null | object |
null |
To change Bootstrap's default Popper config, see Popper's configuration |