The popover is a wrapping component that accepts a “control” as well as a “body”.
A control can be anything that you want to trigger the interaction from. The body will be the contents of what you reveal on the page after triggering the popover. Commonly used as the interaction/wrapping component when composing “dropdowns”, “contextual menus”, “mega menu”, etc, when paired with the menu component.
As a general rule, it is suggested that one popover be revealed on the page at any given time. Opening one popover should close all others to prevent multiple layers and collisions of several popovers.
Popover Structure
The basic wrapping structure of a popover.
fd-popover - wrapper for the whole container
fd-popover__control - control element to toggle the display of the popover
fd-popover__body - wrapper that contains the popover content for CSS-only implementations
fd-popover__popper - wrapper that contains the popover content when implemented using popper.js (use this instead of fd-popover__body). See Implementation Options for more information.
Modifiers
--left, --right - modifier classes for fd-popover__body placement
--no-arrow - modifier to render fd-popover__body or fd-popover__popper without an arrow
Placement Options
There are four placement options:
Left Aligned - This is the default palcement and no extra modifier classes are needed
Right Aligned - A modifier class --right should be applied at the block level wrapper fd-popover and --right to the fd-popover__body warapper
No Arrow & Left Aligned - --no-arrow modifier class on the fd-popover__body wrapper
No Arrow & Right Aligned - Modifier classes --right at the block level wrapper fd-popover, --right and --no-arrow calss on the fd-popover_body
Using popper.js allows for programmatic positioning, but requires slightly different styling. Use the fd-popover__popper class for wrapping the popover content instead of fd-popover__body. See the implementation libraries for specifc details: