Vue3 OverlayPanel is a container component positioned as connected to its target. It supports Vue 3 with PrimeVue 3 and Vue 2 with PrimeVue 2.
Setup
Refer to PrimeVue setup documentation for download and installation steps for your environment such as Vue CLI, Vite or browser.
Import
import OverlayPanel from 'primevue/overlaypanel';
Getting Started
OverlayPanel is accessed via its reference where visibility is controlled using toggle, show and hide methods.
<Button type="button" label="Toggle" @click="toggle" />
<OverlayPanel ref="op">
<img src="demo/images/nature/nature1.jpg" alt="Nature Image">
</OverlayPanel>
toggle(event) {
this.$refs.op.toggle(event);
}
Dismissable and CloseIcon
Clicking outside the overlay hides the panel, setting dismissable to false disables this behavior. Additionally enabling showCloseIcon property displays a close icon at the top right corner to close the panel.
<OverlayPanel ref="op" :showCloseIcon="true" :dismissable="true">
<img src="demo/images/nature/nature1.jpg" alt="Nature Image">
</OverlayPanel>
Theming
OverlayPanel supports various themes featuring Material, Bootstrap, Fluent as well as your own custom themes via the Designer tool.
Resources
Visit the PrimeVue OverlayPanel showcase for demos and documentation.