|

Popovers

Documentation and examples for adding UX4G popovers, like those found in iOS, to any element on your site.

Overview #

Things to know when using the popover plugin:

  • The third-party library Popper is used by Poppers for positioning. It is a must to use one UX4G .bundle.min.js that contains Popper or include popper.min.js before UX4G.js.
  • The popover plugin is a dependency for popovers.
  • Popovers must be initialized by you because they are opt-in for performance reasons.
  • A popover will never appear if the title and content values are zero.
  • To prevent rendering issues in more complicated components (like our input groups, button groups, etc.), use container: 'body'.
  • Popovers cannot be triggered by elements that are concealed.
  • For popovers on a wrapper element, disabled or disabled elements must be triggered.
  • Popovers that are triggered from anchors that wrap across multiple lines will be centered between the width of the anchors. To prevent this behavior, use .text-nowrap on the <a>s.
  • Before their related elements are deleted from the DOM, popovers must first be hidden.
  • An element contained within a shadow DOM can cause popovers.
By default, this component uses the built-in content sanitizer, which strips out any HTML elements that are not explicitly allowed.
The animation effect of this component is dependent on the prefers-reduced-motion media query.

Keep reading to see how popovers work with some examples.