Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 607 Bytes

README.md

File metadata and controls

34 lines (26 loc) · 607 Bytes

@3yourmind/vue-use-tippy

Vue hook for tippy.js

Usage

import { useTippy } from '@3yourmind/vue-use-tippy'
import { computed, defineComponent, ref } from 'vue'

export default defineComponent({
	setup() {
		const contentRef = ref<Element | null>(null)

		useTippy(
			helpTextTriggerRef,
			computed(() => ({
				appendTo: () => document.body,
				content: contentRef.value ?? undefined,
				interactive: true,
				theme: 'light-border',
			})),
		)

		return {
			contentRef,
		}
	},
})

Options

See https://atomiks.github.io/tippyjs/v6/all-props/ for supported options