npm.io
1.0.3 • Published 6 years ago

simple-vue-tooltip

Licence
MIT
Version
1.0.3
Deps
1
Size
8 kB
Vulns
1
Weekly
0

Simple Vue Tooltip

Instantly add tooltips to your existing vue html elements

Setup

Install using npm

npm i simple-vue-tooltip

import into Vue application

import Vue from 'vue'
import Tooltip from 'simple-vue-tooltip';

Add module to Vue

Vue.use(Tooltip);

Usage

Insert into html element using vue directive e.g button

<button
  v-tooltip="{
    tip:'This is a clickable button',
    position: 'bottom'
  }"
  ...
>
  Click Me
</button>

The v-tooltip directive accepts an object containing 2 properties:

  • tip: a custom message to display
  • position: this specifies the position to display tip relative to the containing element

Below are the list of positions currently available

  • bottom: this aligns the tooltip to bottom center of element
  • bottom-left: this aligns the tooltip to bottom left of element
  • bottom-right: this aligns the tooltip to bottom right of element

Keywords