Popovers

A non-disruptive, non-modal dialog used to display additional information about an associated element.

UsageOverview

A popover dialog is a brief, persistent, non-disruptive message returned in the UI based on user action. It is displayed as part of the page on the same Z-index as the page's content.

How to use

Popovers provide a floating element that is subject to the context from its associated element.


AnatomyWriting & Tone

Use “we,” “our” and “you” to create a sense that we are speaking directly to our customers.

Meta information, such as help text and input examples, may be supplied to the user via popovers. System-level alerts and confirmations should use notifications instead.


VariationsTypes

Sizes

Transactional popovers are small and passive popovers are tiny.

BehaviorTrigger & Dismissal

Transactional popover

Passive popover

Focus

Transactional popovers containing form elements should have a focus set on the first element to allow proper keyboard navigation.


Order & Alignment

Even though popovers appear to float on a layer above all other content, they should be displayed as part of the page on the same Z-index as the page's content so they don't interfere with navigation and dropdown menus.

Alignment

Unlike tooltips, popovers can be aligned to an additional 8 positions depending on the type of content or placement on the screen.

Single line

Center positions

Center positions are ideal for tooltips containing a single line of content.

Multi-line

Top left and right

These positions are ideal for trigger elements positioned on the top half of the page.

Bottom left and right

These positions are ideal for trigger elements positioned on the bottom half of the page.

Left top

This position is ideal for left-aligned trigger elements on the top half of the page

Right top

This position is ideal for right-aligned trigger elements on the top half of the page

Left bottom

This position is ideal for left-aligned trigger elements on the bottom half of the page

Right bottom

This position is ideal for right-aligned trigger elements on the bottom half of the page


Overflow

Popovers are non-modal elements and should never be used as a modal replacement. They should be short, practical, and easy to understand / complete.

Popovers should never truncate text or have scrolling, if the content they are intended for doesn't fit, consider using a modal instead.


Best PracticesAccessibility

Include ARIA attributes in the trigger and display elements.

Responsiveness

Due to responsive requirements, using popovers poses logistical difficulties, but may be used judiciously. Length of text is the primary consideration for usage, but function also plays a role.

Because of touch requirements, trigger both components with click events rather than hover or mouseover. This will also aid accessibility and usability concerns by avoiding unintended display of information (inadvertent mouseovers).


Related components
Feedback

We would like to get your feedback. Tell us how you use this component in your projects and how we can improve it.

Style

Behavior Specification
Feature: Floating elements (popovers, tooltips) Background: Subject Given there
      is a floating element with a triangle Scenario: Default direction Given the
      subject has no direction set When I trigger the subject Then it opens to the
      north of the trigger element Scenario: Specified direction Given a subject is
      configured to open to the north When I trigger the subject Then it opens to the
      north of the trigger element Scenario Outline: Out of bounds Given a subject is
      configured to open to the
      <original>
        And it overflows
        <direction>
          When I trigger the subject Then it opens to the
          <adjusted>
            Examples: | direction | original | adjusted | | vertically | n | s | |
            vertically | nnw | ssw | | vertically | s | s | | horizontally | w | e | |
            horizontally | wsw | ese | | horizontally | s | s | | both | s | n | |
            both | nnw | sse |</adjusted
          ></direction
        ></original
      >