The popover has by default the class “popover in popover-{{direction}}”
This is not configurable, I would like to be able to add a class.
Filtering out the most rated answers from issues on Github |||||||||||_______|||| Also a sharing corner
The popover has by default the class “popover in popover-{{direction}}”
This is not configurable, I would like to be able to add a class.
Copyright © 2021 Fantas...hit
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
@pkozlowski-opensource what if there are multiple popovers in a page and wanted to apply styles to one of the popovers. Using general CSS will affect all popovers. So having an option to add the class will be a good option.
The solution given above stands valid If we wanted to use the same styling across all popovers.
I also support this feature request to add a css class to one of my popovers:

At the moment i was able to inject my
error-pop
class with the placement, but this is just a bad hackEdit
No need of that feature if you attach the css class to a parent element:
@JavanXD seems that still needed this feature.
What if you have popover container set as ‘body’ and it is attached to DOM with no parent elements?
The popover parent is in the first red Angular App block while the popover is in the second one on the bottom and it has no parents.
The hack with placement indeed adds provided class to the popover, but it breaks the placement itself.
<div [ngbPopover]="productListContent" #productList="ngbPopover" placement="right dc-products" container="body"> <div class="badge badge-default">New</div> </div>
Agreed that this would be a useful feature. Like others here I need to apply custom styling to some but not all popovers on my page. I worked around it by specifying a particular element as the container but it seems a bit hacky — IMO there should be a way to target a particular popover regardless of its position in the DOM.
I’m really not finding any solution to this issue, especially when container is body. We need the ability to apply classes so that we can style some, but not all, popovers.
For anyone still struggling with this, I was googling this a lot without finding anything useful, but this is actually already supported from long time ago if you look at the popover api. There is actually a🤦
popoverClass
directive which lets you have a custom class on any popover: https://ng-bootstrap.github.io/#/components/popover/api Should’ve read the docs more carefully