1.1.5 • Published 6 years ago

electron-tooltip v1.1.5

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

Electron tooltip

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 install --save-dev 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('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
// example
// in the render process..
const tt = require('electron-tooltip')
tt({
  position: 'bottom',
  width: 200,
  style: {
    backgroundColor: '#f2f3f4',
    borderRadius: '4px'
  }
})
1.1.5

6 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago