OverlayPanel, also known as Popover, is a container component that can overlay other components on page.

import { OverlayPanelModule } from 'primeng/overlaypanel';

OverlayPanel is accessed via its reference and visibility is controlled using toggle, show and hide methods with an event of the target.

<p-button (click)="op.toggle($event)" icon="pi pi-share-alt" label="Share" />
    <p-overlayPanel #op>
        <div class="flex flex-column gap-3 w-25rem">
                <span class="font-medium text-900 block mb-2">Share this document</span>
                    <input pInputText value="https://primeng.org/12323ff26t2g243g423g234gg52hy25XADXAG3" readonly class="w-25rem" />
                        <i class="pi pi-copy"></i>
                <span class="font-medium text-900 block mb-2">Invite Member</span>
                <div class="flex">
                    <p-chips disabled />
                    <p-button label="Invite" icon="pi pi-users" />
                <span class="font-medium text-900 block mb-2">Team Members</span>
                <ul class="list-none p-0 m-0 flex flex-column gap-3">
                    <li *ngFor="let member of members" class="flex align-items-center gap-2">
                        <img [src]="'https://primefaces.org/cdn/primeng/images/demo/avatar/' + member.image" style="width: 32px" />
                            <span class="font-medium">{{ member.name }}</span>
                            <div class="text-sm text-color-secondary">{{ member.email }}</div>
                        <div class="flex align-items-center gap-2 text-color-secondary ml-auto text-sm">
                            <span>{{ member.role }}</span>
                            <i class="pi pi-angle-down"></i>

An example that displays a DataTable inside a popup to select an item.

Bamboo Watch
Bamboo Watch$65

<p-toast />
    icon="pi pi-search" 
    [label]="selectedProduct ? selectedProduct.name : 'Select a Product'" />
<div *ngIf="selectedProduct" class="p-5 surface-card shadow-2 border-round">
    <div class="relative">
            src="https://primefaces.org/cdn/primeng/images/demo/product/{{ selectedProduct.image }}" 
            [alt]="selectedProduct.name" />
    <div class="flex align-items-center justify-content-between mt-3 mb-2">
        <span class="text-900 font-medium text-xl">
            {{ selectedProduct.name }}
        <span class="text-900 text-xl ml-3">
            {{ '$' + selectedProduct.price }}
    <span class="text-600">
        {{ selectedProduct.category }}
<p-overlayPanel #op [style]="{ width: '450px' }" [showCloseIcon]="true">
    <ng-template pTemplate="content">
            (onRowSelect)="onRowSelect($event, op)" 
                <ng-template pTemplate="header">
                        <th pSortableColumn="name">
                            Name <p-sortIcon field="name" />
                        <th pSortableColumn="price">
                            Price <p-sortIcon field="price" />
                <ng-template pTemplate="body" let-rowData let-product>
                    <tr [pSelectableRow]="rowData">
                            {{ product.name }}
                                src="https://primefaces.org/cdn/primeng/images/demo/product/{{ product.image }}" 
                                class="w-5rem shadow-2" />
                        <td>{{ product.price }}</td>

Following is the list of structural style classes, for theming classes visit theming page.

p-overlaypanelContainer element.
p-overlaypanel-contentContent of the panel.
p-overlaypanel-closeClose icon.

Screen Reader

OverlayPanel component uses dialog role and since any attribute is passed to the root element you may define attributes like aria-label or aria-labelledby to describe the popup contents. In addition aria-modal is added since focus is kept within the popup.

It is recommended to use a trigger component that can be accessed with keyboard such as a button, if not adding tabIndex would be necessary. OverlayPanel adds aria-expanded state attribute and aria-controls to the trigger so that the relation between the trigger and the popup is defined.

OverlayPanel Keyboard Support

When the popup gets opened, the first focusable element receives the focus and this can be customized by adding autofocus to an element within the popup.

tabMoves focus to the next the focusable element within the popup.
shift + tabMoves focus to the previous the focusable element within the popup.
escapeCloses the popup and moves focus to the trigger.

Close Button Keyboard Support

enterCloses the popup and moves focus to the trigger.
spaceCloses the popup and moves focus to the trigger.