Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue3-popper

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-popper

A Vue 3 popper component. Uses PopperJS v2.

  • 1.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vue3-popper

A popover component for Vue 3

Documentation

Check out the documentation

Install

NPM

npm install vue3-popper

Yarn

yarn add vue3-popper

Usage

Vue environment

<!-- If your content is only a simple string, you can use the content prop: -->
<template>
  <Popper content="This is the Popper content">
    <button>Trigger element</button>
  </Popper>
</template>

<!-- If your content is more complex, you can use the content slot: -->
<template>
  <Popper>
    <button>Trigger element</button>
    <template #content>
      <div>This is the Popper content</div>
    </template>
  </Popper>
</template>

<script>
  import { defineComponent } from "vue";
  import Popper from "vue3-popper";

  export default defineComponent({
    components: {
      Popper,
    },
  });
</script>

Props

NameDefaultDescription
placementbottomPreferred placement of the Popper
disableClickAwayfalseDisables automatically closing the Popper when the user clicks away from it
offsetSkid0Offset in pixels along the trigger element
offsetDistance12Offset in pixels away from the trigger element
hoverfalseTrigger the Popper on hover
arrowfalseDisplay an arrow on the Popper
arrowPadding0Stop arrow from reaching the edge of the Popper (in pixels)
disabledfalseDisables the Popper. If it was already open, it will be closed.
openDelay0Open the Popper after a delay (ms)
closeDelay0Close the Popper after a delay (ms)
interactivetrueIf the Popper should be interactive, it will close when clicked/hovered if false
contentnullIf your content is just a simple string, you can pass it as a prop
shownullControl the Popper manually, other events (click, hover) are ignored if this is set to true/false
zIndex9999The z-index of the Popper
lockedfalseLock the Popper into place, it will not flip dynamically when it runs out of space if this is set to true

Events

NameDescription
open:popperWhen the Popper is opened
close:popperWhen the Popper is hidden

Slots

NameDescription
contentFor the Popper content

Slot props

The content slot gives you access to useful variables and functions.

NameTypeDescription
closefunctionA function to close the Popper
isOpenbooleanThe open state of the Popper

CSS variables

Popper only comes with some barebones styling by default, but it also uses a list of predefined CSS variables. You can overwrite these variables to suit your needs.

CSS variableExample value
--popper-theme-background-color#ffffff
--popper-theme-background-color-hover#ffffff
--popper-theme-text-colorinherit
--popper-theme-border-width1px
--popper-theme-border-stylesolid
--popper-theme-border-color#eeeeee
--popper-theme-border-radius6px
--popper-theme-padding16px
--popper-theme-box-shadow0 6px 30px -6px rgba(0, 0, 0, 0.25)

Keywords

FAQs

Package last updated on 23 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc