package.docs.components.Popover.examples.Popover.md Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of patternfly Show documentation
Show all versions of patternfly Show documentation
Assets, source, tooling, and content for PatternFly 4
The newest version!
---
id: Popover
section: components
cssPrefix: pf-v6-c-popover
---import './Popover.css'
## Examples
```
{{> popover-close}}
```
### Top
```html isFullscreen
Popover header
Popovers are triggered by click rather than hover. Click again to close.
```
### Right
```html isFullscreen
Popover header
Popovers are triggered by click rather than hover. Click again to close.
```
### Bottom
```html isFullscreen
Popover header
Popovers are triggered by click rather than hover. Click again to close.
```
### Left
```html isFullscreen
Popover header
Popovers are triggered by click rather than hover. Click again to close.
```
### Left top
```html isFullscreen
Popover header
This popover is to the left and at the start position
```
### Left bottom
```html isFullscreen
Popover header
This popover is to the left and at the end position
```
### Bottom left
```html isFullscreen
Popover header
This popover is to the bottom and at the start position
```
### Bottom right
```html isFullscreen
Popover header
This popover is to the bottom and at the end position
```
### Without header/footer
```html isFullscreen
Popovers are triggered by click rather than hover. Click again to close.
```
### No padding
```html isFullscreen
This popover has no padding itself. Instead it is intended for use with content that has its own padding that prevents it from touching the popover container's edges.
```
### Width auto
```html isFullscreen
Popover header
Popovers body
```
### Popover with icon in the title
```html isFullscreen
Popover with icon title
Popovers are triggered by click rather than hover. Click again to close.
```
### Custom alert popover
```html isFullscreen
Custom
alert:
Custom popover title
Popovers are triggered by click rather than hover. Click again to close.
```
### Info alert popover
```html isFullscreen
Info
alert:
Info popover title
Popovers are triggered by click rather than hover. Click again to close.
```
### Success alert popover
```html isFullscreen
Success
alert:
Success popover title
Popovers are triggered by click rather than hover. Click again to close.
```
### Warning alert popover
```html isFullscreen
Warning
alert:
Warning popover title
Popovers are triggered by click rather than hover. Click again to close.
```
### Danger alert popover
```html isFullscreen
Danger
alert:
Danger popover title
Popovers are triggered by click rather than hover. Click again to close.
```
## 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-v6-c-popover` | Identifies the element that serves as the popover container. **Required** |
| `aria-labelledby="[id value of .pf-v6-c-title]"` | `.pf-v6-c-popover` | Gives the popover an accessible name by referring to the element that provides the dialog title. **Required when .pf-v6-c-title is present** |
| `aria-label="[title of popover]"` | `.pf-v6-c-popover` | Gives the popover an accessible name. **Required when .pf-v6-c-title is *not* present** |
| `aria-describedby="[id value of applicable content]"` | `.pf-v6-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-v6-c-popover` | Tells assistive technologies that the windows underneath the current popover are not available for interaction. **Required**|
| `aria-label="Close"` | `.pf-v6-c-button` | Provides 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-v6-c-popover` must not be a descendent of the element with `aria-hidden="true"`. For more info, see [trapping focus](/accessibility/product-development-guide#trapping-focus). **Required** |
| `.pf-v6-screen-reader` | `.pf-v6-c-popover__title-text ` | Adds text to be read saying the alert status before the title. If `.pf-v6-c-popover__title-text` is not used to create a title, this must be added within the title. **Required for popovers that are alerts** |
### Usage
| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-c-popover` | `` | Creates a popover. Always use it with a modifier class that positions the popover relative to the element that triggered it. **Required** |
| `.pf-v6-c-popover__arrow` | `` | Creates an arrow pointing towards the element the popover describes. **Required** |
| `.pf-v6-c-popover__content` | `` | Creates the content area of the popover. **Required** |
| `.pf-v6-c-popover__close` | `` | Positions the close icon in the top-right corner of the popover. **Required if there is a close button** |
| `.pf-v6-c-popover__header` | `` | Creates the popover header. **Required if there is a title**|
| `.pf-v6-c-popover__title` | `` | Creates the popover title. |
| `.pf-v6-c-popover__title-icon` | `` | Creates the popover title icon. |
| `.pf-v6-c-popover__title-text` | ``,``,``,``,``,``,`` | Creates the popover title text. |
| `.pf-v6-c-popover__body` | `` | The popover's body text. **Required** |
| `.pf-v6-c-popover__footer` | `
© 2015 - 2025 Weber Informatics LLC | Privacy Policy