@maximbigler/vue-big-tooltip
| Install | |
|---|---|
npm install @maximbigler/vue-big-tooltip |
|
| Latest Version: | 0.2.1 |
| Vue: | 3 |
| Last Updated: | Oct 7, 2026 |
| Links: | GitHub · npm |
big-tooltip
A small tooltip library for Vue 3. You can use it as a directive, a component or a composable. Positioning is handled by Floating UI.
Getting Started
pnpm add @maximbigler/vue-big-tooltip
Register the plugin. Everything you pass here becomes the default for every tooltip in your app.
import { createApp } from 'vue';
import { TooltipPlugin } from '@maximbigler/vue-big-tooltip';
import App from './App.vue';
createApp(App).use(TooltipPlugin, { placement: 'top' }).mount('#app');
The styles get imported automatically, so you don't have to add a CSS file yourself.
Directive
<button v-tooltip="'Hello there'">Hover me</button>
<!-- the argument sets the placement -->
<button v-tooltip:right="'On the right'">Hover me</button>
<!-- or pass an object -->
<button v-tooltip="{ content: '<b>Bold</b>', html: true }">Hover me</button>
You can also use the .html and .interactive modifiers instead of setting them in the object.
Component
<Tooltip content="Hello there" placement="bottom">
<button>Hover me</button>
</Tooltip>
The component wraps its content in a span. If you need a different element, use the as prop.
Composable
If you want to control the tooltip yourself:
<script setup lang="ts">
import { useTemplateRef } from 'vue';
import { useTooltip } from '@maximbigler/vue-big-tooltip';
const anchor = useTemplateRef<HTMLElement>('anchor');
const { show, hide, isOpen } = useTooltip(anchor, { content: 'Hello there' });
</script>
<template>
<button ref="anchor" @click="isOpen ? hide() : show()">Toggle</button>
</template>
Properties
| Properties | defaults | descriptions |
|---|---|---|
| content | '' |
The content which should be displayed |
| placement | 'bottom' |
The placement relative to the anchor |
| offset | 8 |
The distance in px between the tooltip and the anchor |
| showDelay | 100 |
How long it takes in ms to show the tooltip |
| hideDelay | 100 |
How long it takes in ms to remove the tooltip |
| theme | 'default' |
The theme which should be selected |
| html | false |
Enable html rendering at your own risk |
| interactive | false |
Make the tooltip interactive, so it remains open on hover |
| arrow | true |
Show the arrow pointing to the anchor |
| disabled | false |
Disables the tooltip |
| triggers | ['hover', 'focus'] |
When it should be opened |
Theming
There are two themes out of the box: default (dark) and light.
Every tooltip gets the class tooltip--<theme>, so making your own theme is just a matter of overriding some CSS variables:
.tooltip--brand {
--tooltip-background: #42b883;
--tooltip-color: #ffffff;
}
<Tooltip content="Hello there" theme="brand">
<button>Hover me</button>
</Tooltip>
These are the variables you can change:
| Variable | default |
|---|---|
--tooltip-background |
#1f2937 |
--tooltip-color |
#f9fafb |
--tooltip-radius |
6px |
--tooltip-padding |
6px 10px |
--tooltip-font-size |
13px |
--tooltip-max-width |
260px |
--tooltip-z-index |
9999 |
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.2.1 | ^3.5.0 | ||
| 0.1.0 | ^3.5.0 |
Pre-releases (1)
| Version | Released | License |
|---|---|---|
| 0.0.0-stage |