Rate these docs

Vue Bootstrap Popovers

Vue Popovers - Bootstrap 4 & Material Design

Vue Bootstrap popover is a component which displays a box with a content after a click on an element - similar to the tooltip but can contain more content.


Examples

Click the buttons below to see tooltips:


          <template>
            <mdb-container>
              <mdb-popover trigger="click" :options="{placement: 'top'}">
                <span slot="header">popover on top</span>
                <span slot="body">Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</span>
                <mdb-btn slot="reference">
                  Popover on top
                </mdb-btn>
              </mdb-popover>
              <mdb-popover trigger="click" :options="{placement: 'right'}">
                <span slot="header">popover on right</span>
                <span slot="body">Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</span>
                <mdb-btn slot="reference">
                  Popover on right
                </mdb-btn>
              </mdb-popover>
              <mdb-popover trigger="click" :options="{placement: 'bottom'}">
                <span slot="header">popover on bottom</span>
                <span slot="body">Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</span>
                <mdb-btn slot="reference">
                  Popover on bottom
                </mdb-btn>
              </mdb-popover>
              <mdb-popover trigger="click" :options="{placement: 'left'}">
                <span slot="header">popover on left</span>
                <span slot="body">Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</span>
                <mdb-btn slot="reference">
                  Popover on left
                </mdb-btn>
              </mdb-popover>
            </mdb-container>
          </template>
        

          <script>
            import { mdbContainer, mdbPopover, mdbBtn } from 'mdbvue';
            export default {
              name: 'PopoverExample',
              components: {
                mdbContainer,
                mdbPopover,
                mdbBtn
              }
            }
          </script>
        

Note: We can help you build your project.
learn more

Popovers - API

In this section you will find advanced information about the Popovers component. You will learn which modules are required in this component, what are the possibilities of configuring the component, and what events and methods you can use in working with it.


Import statement


import { mdbPopover } from 'mdbvue';
      

API Reference: Properties

Name Type Default Description Example
delayOnMouseOut Number 10 Setting the animation delay <mdb-popover :delayOnMouseOut="20">
disabled Boolean Disables popover <mdb-popover disabled>
options Object {placement: 'top'} Determines popover options <mdb-popover :options="{placement: 'top'}">
trigger String 'click' Determines start event. <mdb-popover trigger="click">

API Reference: slots

Name Description Example
reference This is a target, upon / beside / below of which our hero will emerge
<mdb-popover>
    <span slot="header">
        be ahead
    </span>
    <span slot="body">
        move that body
    </span>
    <mdb-btn slot="reference">
        Click me, baby
    </mdb-btn>
</mdb-popover>
header Gets inserted into a div.popover-header
<mdb-popover>
    <span slot="header">
        hats go on heads
    </span>
    <mdb-btn slot="reference">
        Popover on top
    </mdb-btn>
</mdb-popover>
body Helps to build popover's body
<mdb-popover>
    <span slot="body">
        shake that lower body part
    </span>
    <mdb-btn slot="reference">
        Yes
    </mdb-btn>
</mdb-popover>

Image popover

An example of having a picture instead of text inside the popover body.


              <template>
                <mdb-container>
                  <mdb-popover trigger="hover" :options="{placement: 'bottom'}">
                    <img src="https://mdbootstrap.com/img/logo/mdb192x192.jpg" slot="body"/>
                    <mdb-btn slot="reference" color="primary">
                      Hover over me
                    </mdb-btn>
                  </mdb-popover>
                  <mdb-popover trigger="click" :options="{placement: 'bottom'}">
                    <img src="https://mdbootstrap.com/img/Others/documentation/img%20(30)-mini.jpg" slot="body"/>
                    <mdb-btn slot="reference" color="indigo">
                      Click me
                    </mdb-btn>
                  </mdb-popover>
                  <mdb-popover trigger="hover" :options="{placement: 'bottom'}">
                    <img src="//placehold.it/100x50" slot="body"/>
                    <mdb-btn slot="reference" color="dark-green">
                      Hover over me
                    </mdb-btn>
                  </mdb-popover>
                  <mdb-popover trigger="click" :options="{placement: 'bottom'}">
                    <img src="//placehold.it/100x50g" slot="body"/>
                    <mdb-btn slot="reference" color="purple">
                      Click me
                    </mdb-btn>
                  </mdb-popover>
                </mdb-container>
              </template>
            

              <script>
                import { mdbContainer, mdbPopover, mdbBtn } from 'mdbvue';
                export default {
                  name:'ImagePopoverExample',
                  components: {
                    mdbContainer,
                    mdbPopover,
                    mdbBtn
                  }
                }
              </script>