PF Next

Popover

Popover Top

Preview

<div class="pf-c-popover pf-m-top" role="dialog" aria-modal="true" aria-labelledby="popover-top-header" aria-describedby="popover-top-body">
  <div class="pf-c-popover__arrow">
  </div>
  <div class="pf-c-popover__content">
    <div class="pf-c-popover__close">
      <button class="pf-c-button pf-m-plain" aria-label="Close">
        <i class="fas fa-times"></i>
      </button>
    </div>
    <header class="pf-c-popover__header">
      <h1 class="pf-c-popover__header-title" id="popover-top-header">
        Popover Header
      </h1>
    </header>
    <div class="pf-c-popover__body" id="popover-top-body">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id feugiat augue, nec fringilla turpis.
    </div>
  </div>
</div>

Popover Right

Preview

<div class="pf-c-popover pf-m-right" role="dialog" aria-modal="true" aria-labelledby="popover-right-header" aria-describedby="popover-right-body">
  <div class="pf-c-popover__arrow">
  </div>
  <div class="pf-c-popover__content">
    <div class="pf-c-popover__close">
      <button class="pf-c-button pf-m-plain" aria-label="Close">
        <i class="fas fa-times"></i>
      </button>
    </div>
    <header class="pf-c-popover__header">
      <h1 class="pf-c-popover__header-title" id="popover-right-header">
        Popover Header
      </h1>
    </header>
    <div class="pf-c-popover__body" id="popover-right-body">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id feugiat augue, nec fringilla turpis.
    </div>
  </div>
</div>

Popover Bottom

Preview

<div class="pf-c-popover pf-m-bottom" role="dialog" aria-modal="true" aria-labelledby="popover-bottom-header" aria-describedby="popover-bottom-body">
  <div class="pf-c-popover__arrow">
  </div>
  <div class="pf-c-popover__content">
    <div class="pf-c-popover__close">
      <button class="pf-c-button pf-m-plain" aria-label="Close">
        <i class="fas fa-times"></i>
      </button>
    </div>
    <header class="pf-c-popover__header">
      <h1 class="pf-c-popover__header-title" id="popover-bottom-header">
        Popover Header
      </h1>
    </header>
    <div class="pf-c-popover__body" id="popover-bottom-body">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id feugiat augue, nec fringilla turpis.
    </div>
  </div>
</div>

Popover Left

Preview

<div class="pf-c-popover pf-m-left" role="dialog" aria-modal="true" aria-labelledby="popover-left-header" aria-describedby="popover-left-body">
  <div class="pf-c-popover__arrow">
  </div>
  <div class="pf-c-popover__content">
    <div class="pf-c-popover__close">
      <button class="pf-c-button pf-m-plain" aria-label="Close">
        <i class="fas fa-times"></i>
      </button>
    </div>
    <header class="pf-c-popover__header">
      <h1 class="pf-c-popover__header-title" id="popover-left-header">
        Popover Header
      </h1>
    </header>
    <div class="pf-c-popover__body" id="popover-left-body">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id feugiat augue, nec fringilla turpis.
    </div>
  </div>
</div>

Popover No Header

Preview

<div class="pf-c-popover pf-m-right" role="dialog" aria-modal="true" aria-label="Popover with no header example" aria-describedby="popover-no-header-body">
  <div class="pf-c-popover__arrow">
  </div>
  <div class="pf-c-popover__content">
    <div class="pf-c-popover__close">
      <button class="pf-c-button pf-m-plain" aria-label="Close">
        <i class="fas fa-times"></i>
      </button>
    </div>
    <div class="pf-c-popover__body" id="popover-no-header-body">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id feugiat augue, nec fringilla turpis.
    </div>
  </div>
</div>

Documentation

Overview

A popover is used to provide contextual information for another component on click. The popover itself is made up of two main elements: arrow and content. The content element follows the pattern of the popover box component, with a close icon in the top right corner, as well as a header and body. One of the directional modifiers (.pf-m-left, .pf-m-top, etc.) is required on the popover component

Accessibility

Attribute Applies to Outcome
role="dialog" .pf-c-popover Identifies the element that serves as the popover container. Required
aria-labelledby="[id value of .pf-c-popover__header-title]" .pf-c-popover Gives the popover an accessible name by referring to the element that provides the dialog title. Required when .pf-c-popover__header-title is present
aria-label="[title of popover]" .pf-c-popover Gives the popover an accessible name. Required when .pf-c-popover__header-title is not present
aria-describedby="[id value of applicable content]" .pf-c-popover Gives the popover an accessible description by referring to the popover content that describes the primary message or purpose of the dialog. Not used if there is no static text that describes the popover.
aria-modal="true" .pf-c-popover Tells assistive technologies that the windows underneath the current popover are not available for interaction. Required
aria-label="Close" .pf-c-popover__close .pf-c-button Provides an accessible name for the close button as it uses an icon instead of text. Required

Usage

Class Applied To Outcome
.pf-c-popover <div> Creates a popover. Always use it with a modifier class that positions the popover relative to the element that triggered it. Required
.pf-c-popover__arrow <div> Creates an arrow pointing towards the element the popover describes. Required
.pf-c-popover__content <div> Creates the body of the popover. Required
.pf-c-popover__close <div> Contains and positions the close icon in the top-right corner of the popover. Required
.pf-c-popover__header <header> The header text area of the popover.
.pf-c-popover__header-title <h1>,<h2>,<h3>,<h4>,<h5>,<h6> The actual popover title.
.pf-c-popover__body <div> The popover's body text. Required
.pf-m-left .pf-c-popover Positions the popover to the left of the element.
.pf-m-right .pf-c-popover Positions the popover to the right of the element.
.pf-m-top .pf-c-popover Positions the popover to the top of the element.
.pf-m-bottom .pf-c-popover Positions the popover to the bottom of the element.