Multipurpose scenarios with OverlayPanel

The OverlayPanel is a container component that displays additional information on top of the other components in the page. This element will be displayed using the show or toggle method of a local ng-template variable, and it can be hidden using the hide or toggle method. Remember that the show method will allow a second argument as the target element, where it has to display the Overlay (instead source). A basic example of the Overlay component with the source button generator will be written as follows:

<p-overlayPanel #overlaybasic>
<img src="/assets/data/images/primeng.png" alt="PrimeNG Logo" />
</p-overlayPanel>
<button type="button" pButton label="Logo" (click)="overlaybasic.toggle($event)"></button>

In the preceding example, Overlay will appear by the click of the Button component. The following screenshot shows a snapshot result of the basic Overlay example:

In the preceding snapshot, the Overlay displays the PrimeNG logo as a image on the click of the logo button. By default, OverlayPanel is attached to the body of the page, but the target can be changed using the appendTo property.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.153.212