vue-tippy
TypeScript icon, indicating that this package has built-in type declarations

6.4.1 • Public • Published

VueTippy - V6

npm vue2 download

Vue.js 3 wrapper for Tippy.js

For Tippy.js v4 use v4 branch

Documentation

For full v6 documentation, visit https://vue-tippy.netlify.app/.

Installation

npm install vue-tippy@v6

//or

yarn add vue-tippy@v6

Configuration (optional)

import { createApp } from 'vue'

import VueTippy from 'vue-tippy'
// or
import { plugin as VueTippy } from 'vue-tippy'

const app = createApp({})

app.use(
  VueTippy,
  // optional
  {
    directive: 'tippy', // => v-tippy
    component: 'tippy', // => <tippy/>
  }
)

app.mount('#app')

Usage

Vue Directive

<template>
  <button v-tippy="{ content: 'Hi!' }">Tippy!</button>
  <button v-tippy="'Hello!'">Tippy!</button>
</template>

<script setup>
import { directive as VTippy } from 'vue-tippy'
</script>

Vue Component

<template>
  <Tippy content="Hi!">
    <button>Tippy!</button>
  </Tippy>
</template>

<script setup>
import { Tippy } from 'vue-tippy'
</script>

Using composition api

import { defineComponent, ref, h } from 'vue'
import { useTippy } from 'vue-tippy'

export default defineComponent({
  setup() {
    const button = ref()

    useTippy(button, {
      content: 'Hi!',
    })

    return () => h('button', { ref: button }, 'Tippy!')
  },
})

Readme

Keywords

none

Package Sidebar

Install

npm i vue-tippy

Weekly Downloads

81,981

Version

6.4.1

License

MIT

Unpacked Size

868 kB

Total Files

36

Last publish

Collaborators

  • kabbouchi