HTML

Popover

ExamplesDocumentationCSS Variables

Examples

Top

Bottom

Left

Without header/footer

Documentation

Overiew

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

AttributeApplies toOutcome
role="dialog".pf-c-popoverIdentifies the element that serves as the popover container. Required
aria-labelledby="[id value of .pf-c-title]".pf-c-popoverGives the popover an accessible name by referring to the element that provides the dialog title. Required when .pf-c-title is present
aria-label="[title of popover]".pf-c-popoverGives the popover an accessible name. Required when .pf-c-title is not present
aria-describedby="[id value of applicable content]".pf-c-popoverGives 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-popoverTells assistive technologies that the windows underneath the current popover are not available for interaction. Required
aria-label="Close".pf-c-buttonProvides an accessible name for the close button as it uses an icon instead of text. Required
aria-hidden="true"Parent element containing the page contents when the popover is open.Hides main contents of the page from screen readers. The element with .pf-c-popover must not be a descendent of the element with aria-hidden="true". For more info see trapping focus. Required

Usage

ClassApplied toOutcome
.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 content area of the popover. Required
.pf-c-button<button>Positions the close icon in the top-right corner of the popover. Required
.pf-c-title<h1>,<h2>,<h3>,<h4>,<h5>,<h6>Initiates a title. Always use it with a modifier class. See title component for more info.
.pf-c-popover__body<div>The popover's body text. Required
.pf-c-popover__footer<footer>Initiates a popover footer.
.pf-m-left.pf-c-popoverPositions the popover to the left of the element.
.pf-m-right.pf-c-popoverPositions the popover to the right of the element.
.pf-m-top.pf-c-popoverPositions the popover to the top of the element.
.pf-m-bottom.pf-c-popoverPositions the popover to the bottom of the element.

CSS Variables

--pf-c-popover__arrow--BackgroundColorc_popover__arrow_BackgroundColor
#fff
--pf-c-popover__arrow--BoxShadowc_popover__arrow_BoxShadow
0 0.0625rem 0.0625rem 0rem rgba(3,3,3,0.05),0 0.25rem 0.5rem 0.25rem rgba(3,3,3,0.06)
--pf-c-popover__arrow--Heightc_popover__arrow_Height
1.5625rem
--pf-c-popover__arrow--m-bottom--Transformc_popover__arrow_m_bottom_Transform
translate(-50%,-50%) rotate(45deg)
--pf-c-popover__arrow--m-left--Transformc_popover__arrow_m_left_Transform
translate(50%,-50%) rotate(45deg)
--pf-c-popover__arrow--m-right--Transformc_popover__arrow_m_right_Transform
translate(-50%,-50%) rotate(45deg)
--pf-c-popover__arrow--m-top--Transformc_popover__arrow_m_top_Transform
translate(-50%,50%) rotate(45deg)
--pf-c-popover__arrow--Widthc_popover__arrow_Width
1.5625rem
--pf-c-popover__content--BackgroundColorc_popover__content_BackgroundColor
#fff
--pf-c-popover__content--PaddingBottomc_popover__content_PaddingBottom
2rem
--pf-c-popover__content--PaddingLeftc_popover__content_PaddingLeft
2rem
--pf-c-popover__content--PaddingRightc_popover__content_PaddingRight
2rem
--pf-c-popover__content--PaddingTopc_popover__content_PaddingTop
2rem
--pf-c-popover__footer--MarginTopc_popover__footer_MarginTop
1.5rem
--pf-c-popover--BoxShadowc_popover_BoxShadow
0 0.0625rem 0.0625rem 0rem rgba(3,3,3,0.05),0 0.25rem 0.5rem 0.25rem rgba(3,3,3,0.06)
--pf-c-popover--c-button--MarginLeftc_popover_c_button_MarginLeft
0.5rem
--pf-c-popover--c-button--Rightc_popover_c_button_Right
1rem
--pf-c-popover--c-button--sibling--PaddingRightc_popover_c_button_sibling_PaddingRight
2rem
--pf-c-popover--c-button--Topc_popover_c_button_Top
calc(2rem - 0.375rem + 0.0625rem)
--pf-c-popover--c-title--MarginBottomc_popover_c_title_MarginBottom
1rem
--pf-c-popover--MaxWidthc_popover_MaxWidth
calc(2rem + 18.75rem)
--pf-c-popover--MinWidthc_popover_MinWidth
calc(2rem + 6.25rem)