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 |
array |
['top', 'right', 'bottom', 'left'] |
Define fallback placements by providing a list of placements in array (in order of preference). For more information refer to
Popper's behavior docs |
boundary |
string | element |
'clippingParents' |
Overflow constraint boundary of the popover. By default it's 'clippingParents' and can accept 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. |
offset |
array | string | function |
[0, 8] |
Offset of the popover relative to its target. You can pass a string in data attributes with comma separated values like: data-bs-offset="10,20"
When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: [skidding, distance] .
For more information refer to Popper's offset docs.
|
popperConfig |
null | object |
null |
To change Bootstrap's default Popper config, see Popper's configuration |