Popovers
Popovers are a type of container that appear over existing content on the page. Popovers allow users to either enter additional data related to an element on a screen or view detailed content related to that element.
Current Loadfactor: 90
Expected Loadfactor: 95
Current Loadfactor LY: 92
Final Loadfactor LY: 0
When to Use
- Use a popover to create contextual relationships between a single element displayed on a screen and a more complex set of supporting content or form controls. For example, use a popover when providing additional options related to a filter.
- Use to display rich text/content that you can’t fit into a tooltip.
When Not to Use
- Do not use a popover for simple content such as additional help text related to a word or phrase. Instead, use a tooltip.
Usage
- Popovers can be activated by a button, link, icon or form control. Unlike tooltips which display on hover for non-touch displays, popovers are invoked by clicking or tapping an element.
- Popovers can be closed via a close icon, by clicking a button or clicking anywhere outside of the popover.
- The amount of content in a popover should be relatively short. Consider placing longer content in a Modal.
- Popovers should be positioned based on the available screen space and layout.
Developer Notes
Current Loadfactor: 90
Expected Loadfactor: 95
Current Loadfactor LY: 92
Final Loadfactor LY: 0
Popovers are created by adding the .spark-popover
class to an element. The two primary components of a popover are the toggle and the content.
The toggle is used to show/hide the content and it is created by adding a class of .spark-popover__toggle
to an element inside the popover.
The content is created using a class of .spark-popover__content--top
, .spark-popover__content--bottom
, .spark-popover__content--left
or .spark-popover__content--right
. These different content classes determine the position of the popover.
Additionally, a list of navigation items can be defined as the content for a popover. This is done by adding the .spark-popover__list
class to the content and creating list items and links using the .spark-popover__list-item
and .spark-popover__list-link
classes to define menu items.