Socket
Book a DemoInstallSign in
Socket

akido-electron-tooltip

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

akido-electron-tooltip

Free your tooltips from their window bounds - Update version

1.2.6
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Akido Electron tooltip

Introduction

This module is a fork of Electron tooltip, with improved support for the lastest version of electron (>5).

The documentation is the same. The name has changed.

Description

This module is intended to be used in Electron applications. It allows for tooltips to flow outside the window bounds they're called from.

Installation

npm i akido-electron-tooltip

Usage

After importing the module, it will search for elements that have the data-tooltip attribute attached. A configuration object can be passed in when calling the tooltip function.

// in the render process..
const tt = require('akido-electron-tooltip')
tt({
  // config properties
})

Position, width and offset options can be overriden on a per element basis by using the data-tooltip-{option} attribute.

<!-- basic example: -->
<a href="http://www.facebook.com" data-tooltip="Go to Facebook" data-tooltip-position="bottom"></a>

Configuration options

optiondescriptiondefaultvalues
positionTooltip directiontopleft, top, right, bottom
widthWidth of the tooltip. If width is set to auto, the tooltip will not wrap contentauto> 0
offsetOffset from the element to the tooltip0> 0
styleObject for overwriting default styles{}
customContentFunction that will be called each time the tooltip is shown. Takes two arguments: the element on which it was called, and the current value of data-tooltip. It should return a string which will be used instead of the data-tooltip valueundefined
levelIt's possible to specify the level of the tooltip (check: https://electronjs.org/docs/api/browser-window#winsetalwaysontopflag-level-relativelevel)'floating''normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver'
relativeLevelIt's possible to specify the relative level of the tooltip (check: https://electronjs.org/docs/api/browser-window#winsetalwaysontopflag-level-relativelevel)0integer
// example
// in the render process..
const tt = require('akido-electron-tooltip')
tt({
  position: 'bottom',
  width: 200,
  style: {
    backgroundColor: '#f2f3f4',
    borderRadius: '4px'
  },
  level: 'pop-up-menu',
  relativeLevel: 2 
})

FAQs

Package last updated on 12 Dec 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.