QPopover should be used when you want a menu (or any content) to be displayed on a popup as a result of user clicking/tapping on a DOM element / component.


Edit /quasar.conf.js:

framework: {
components: ['QPopover'],

// optional if you want to use
// directive `v-close-overlay`
directives: ['CloseOverlay']

Basic Usage

In the example below we use a Button (as a target) and when clicking/tapping on it Quasar will display a List.

You can replace the QBtn and the List with any DOM elements or components you like.

The target button (can be anything else)
must be direct parent of QPopover on the
DOM hierarchy.
<q-btn label="Email">
<!-- Direct child of target -->
The DOM element(s) that make up the popup,
in this case a list:
<q-list separator link>
<!-- notice `v-close-overlay` which closes popover -->
<q-item v-close-overlay @click.native="doSomething">

The idea is to place QPopover inside your DOM element / component that you want to be the trigger as direct child. Don’t worry about QPopover content inheriting CSS from the container as the QPopover will be injected as a direct child of <body>.

When on a browser, hitting the <ESCAPE> key also closes the QPopover.

Toggle through v-model

<q-btn color="primary" @click="showing = true" label="Show" />
<q-btn color="primary" @click="showing = false" label="Hide" />

<q-popover v-model="showing">...</q-popover>

export default {
data () {
return {
showing: false

Vue Properties

Vue PropertyTypeDescription
anchorObjectString of form bottom left (vertical horizontal)
anchor-clickBooleanDisable triggering the Popover by clicking/tapping on the parent element.
no-focusBoolean(v0.17+) By default, for accessibility purposes, Popover focuses its content when it will be displayed. For use-cases when you need to keep focus on your current element, set this to true.
no-refocusBoolean(v0.17+) By default, for accessibility purposes, Popover refocuses the previously active element. Set to true to disable this behaviour.
selfObjectString of form top left (vertical horizontal)
max-heightStringOptional maximum height of Popover content. Example: 500px
touch-positionBooleanOpen Popover from the position where user clicked/tapped on anchor, and keep the same relative position on scroll.
fitBooleanPopover has min-width set as same as the width of the container.
disableBooleanWhen set to true, Popover won’t be triggered.
offsetArray of 2 NumbersOffset on horizontal and vertical (in pixels). Example: [18, 18].
coverBoolean(v0.17.10+) Popover will cover its parent element.
persistentBoolean(v0.17.10+) Popover will not be closed if clicking/tapping outside of it, like it happens by default.
keep-on-screenBoolean(v0.17.13+) Popover will not be closed if the parent element gets out of screen.

Vue Methods

showOpen Popover. Takes one optional Function parameter to trigger after Popover is opened.
hideClose Popover. Takes one optional Function parameter to trigger after Popover is closed.
toggleToggle open/close Popover state. Takes one optional Function parameter to trigger after Popover is toggled.

Vue Events

Vue MethodDescription
@showTriggered after opening Popover.
@hideTriggered after closing Popover.

Handling Popover Dismissal

By default, clicking/tapping outside the QPopover content will close it. But if you’d like elements from the QPopover content to close it, then use the v-close-overlay Quasar directive.

Handling Positioning

Position of the QPopover can be customized. It keeps account of the optional anchor and self Vue properties. See the demo and play with them.

The final position of the QPopover popup is calculated so that it will be displayed on the available screen real estate, switching to right-side and/or top-side when necessary.

If you would like the QPopover to appear from the touch/click point triggering the QPopover open, then use the Boolean touch-position Vue property:

<q-popover touch-position>

The demo has touch-position specified for the big image on the center of the page.