Skip to content

vTooltip

vTooltip is a Vue 3 directive to display a text when the user hovers an element

Basic usage

Hover the buttons

Colors

Hover the buttons

Open programmatically

Global install

Vue 3

main.ts

typescript
import { createApp } from 'vue'
import { vTooltipInstall } from 'maz-ui'

const app = createApp(App)

// Options are optional
app.use(vTooltipInstall, {
  position: 'top',
  color: 'primary',
})

app.mount('#app')

Nuxt

Please refer to the Nuxt module documentation for more information.

Types

ts
type vTooltipOptions = {
  position?: 'top' | 'bottom' | 'left' | 'right'
  color?: "primary" | "secondary" | "info" | "success" | "warning" | "danger" | "white" | "black" | "theme" | "default" | "light" | "dark"
}

type vTooltipBindingValue =
  | string
  | ({
      text: string
      open?: boolean
    } & vTooltipOptions)