Skip to content

Popovers

A popover is a small overlay that displays supplemental information to the user. It can contain rich content and is triggered when the UI element it relates to is selected.

Code

Relies on the third-party librarybootstrap.js(4.6)for its features and functionality.View Bootstrap’s popover doc
Select a button to view the popover.
<button class="btn btn--brand" type="button" data-toggle="popover" data-trigger="focus" data-placement="top" data-content="">…</button>

NameAttributeCopy

  1. content
    data-content=""
  2. has header
    title=""
  3. on top
    data-placement=“top”
  4. on left
    data-placement=“left”
  5. on right
    data-placement=“right”
  6. on bottom
    data-placement=“bottom”

In Practice

Use popovers for non-essential information that provides the user with additional guidance or actions.

  • Can contain a header, formatted text, links, etc.
  • Displaying a popover requires a user action (click, tap, or select via key command).
  • Dismissing a popover also requires a user action.
  • Be mindful of placement - a popover should not obscure critical elements on the page.

Accessibility

  • Popovers should be operable using the keyboard alone.
  • Popovers should be announced by screen readers.
  • When a popover is opened, focus should be moved to the popover so that keyboard users can interact with it.
  • When the popover is closed, focus should be returned to the element that triggered it.

For more information, see our accessibility guidelines.

Design resources

View component in Figma