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

popper-plugin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

popper-plugin

A javascript plugin for popper which could be used to positioning tooltip or popover

  • 1.0.5
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Popper Plugin

A javascript plugin for popper which could be used to positioning tooltip or popover

Install

npm install --save popper-plugin

Import file

<script src="node_modules/popper-plugin/dist/popper.min.js"></script>

Initialize plugin

const samplePopper = new PopperComponent({
  /** Refer below for available properties */
});

Properties

NameTypeDefault valueDescription
$popperEleElementPopper element
$triggerEleElementTrigger element
$arrowEleElementArrow icon in the popper
positionNumberautoPosition of popper (top, bottom, left, right, auto)
marginNumber8Space between popper and its activator (in pixel)
offsetNumber5Space between popper and window edge (in pixel)
enterDelayNumber0Delay time before showing popper (in milliseconds)
exitDelayNumber0Delay time before hiding popper (in milliseconds)
showDurationNumber300Transition duration for show animation (in milliseconds)
hideDurationNumber200Transition duration for hide animation (in milliseconds)
transitionDistanceNumber10Distance to translate on show/hide animation (in pixel)
zIndexNumber1CSS z-index value for popper
afterShowFunctionCallback function to trigger after show
afterHideFunctionCallback function to trigger after hide

Methods

show()

/**
 * @prop {boolean} [resetPosition] - Recalculate position before show
 * @prop {object} [data] - Any custom data which would be passed to afterShow callback function call
 */
samplePopper.show({});

hide()

/**
 * @prop {object} [data] - Any custom data which would be passed to afterHide callback function call
 */
samplePopper.hide({});

updatePosition()

To recalculate the position of the popper element. Which colud be used when scrolling the parent element.

samplePopper.updatePosition();

Keywords

FAQs

Package last updated on 24 Apr 2024

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