1.0.0 • Published 5 years ago

wired-tooltip v1.0.0

Weekly downloads
25
License
MIT
Repository
github
Last release
5 years ago

wired tooltip

wired-tooltip

Tooltip with text that appears on hover over an element. It will be centered to an anchor element specified in the 'for' attribute, or, if that doesn't exist, centered to the parent node containing it.

For demo and view the complete set of wired-elememts: wiredjs.com

Learn about web components here.

Usage

Add wired-tooltip to your project:

npm i wired-tooltip

Import wired-tooltip definition into your HTML page:

<script type="module" src="wired-tooltip/wired-tooltip.js"></script>

Or into your module script:

import { WiredTooltip } from "wired-tooltip"

Use it in your web page:

<div>
  <div class="inline">
    <button>Click me!</button>
    <wired-tooltip text="Below"></wired-tooltip>
  </div>
  <button id="btn">Click me!</button>
  <wired-tooltip position="top" for="btn" text="Above"></wired-tooltip>
</div>

Properties

for - Id of the element the tooltip is for. Optional.

position - String value: left/right/top/bottom. Default is bottom.

text - Text in the tooltip.

Custom CSS Variables

--wired-tooltip-border-color Border color of the tooltip. Default is currentColor.

--wired-tooltip-background Background color of the tooltip.

License

MIT License (c) Preet Shihn

1.0.0

5 years ago

1.0.0-alpha.0

5 years ago

0.9.0

5 years ago

0.9.0-1

5 years ago

0.9.0-0

5 years ago

0.8.0

6 years ago

0.8.0-0

6 years ago

0.6.5

6 years ago

0.6.0

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago