Floating Vue, currently at version 5.x, is a robust and flexible library for creating tooltips, popovers, dropdowns, and menus in Vue 3 applications. It is the successor to the original `v-tooltip` package, having been rebranded from `floating-vue` v2.x to `v-tooltip` v5.x to streamline versioning and prevent confusion, while retaining the same underlying codebase and functionality. The library leverages `@floating-ui/dom` for efficient and precise anchor positioning, ensuring floating elements are always positioned optimally. It offers both directive-based (`v-tooltip`, `v-close-popper`) and component-based (`VDropdown`, `VTooltip`, `VMenu`) usage, supporting a wide range of interactive UI patterns. Releases are regular, with a focus on Vue 3 compatibility, performance, and improved TypeScript typings. Key differentiators include its extensive configuration options, powerful theming capabilities, and seamless integration with Vue 3's composition API.
npm install v-tooltipVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates both the `v-tooltip` directive and the `VDropdown` component from Floating Vue in a Vue 3 `script setup` environment, including global registration and CSS import.
For Vue 2 projects, continue using `floating-vue` v1 (which corresponds to `v-tooltip` v3/v4) or `v-tooltip` v2. For Vue 3 projects, install `v-tooltip` v5.x and migrate according to the `floating-vue` v2 migration guide, paying attention to the package rename and API changes.
Update all import statements from `v-tooltip` to `floating-vue`. For example, `import { VTooltip } from 'v-tooltip'` should become `import { VTooltip } from 'floating-vue'`.Review your component usage for `modifiers` and `offset` props. Replace `modifiers` with the new individual props, and refactor `offset` to use `distance` and `skidding` separately. Consult the migration guide for specific property mappings.
Prefer using the `v-tooltip` and `v-close-popper` directives where possible. For complex popovers, `VDropdown` and `VMenu` components are still the recommended approach.
Ensure you import the default stylesheet: `import 'floating-vue/dist/style.css';` in your main application entry file (e.g., `main.ts` or `main.js`).
Globally disable HTML parsing for tooltips by setting `defaultHtml: false` in the plugin options: `app.use(FloatingVue, { defaultHtml: false })`. You can then re-enable HTML for specific tooltips with `v-tooltip="{ content: '...', html: true }"` if strictly necessary and after proper sanitization.Ensure that Floating Vue components are rendered client-side only during SSR, or integrate with your SSR framework (e.g., Nuxt) to handle DOM-dependent code. For Vue, wrap the component in `<ClientOnly>` or dynamically import it on the client. Upgrading to the latest v5.x might also resolve some edge cases.
If using globally, ensure `import FloatingVue from 'floating-vue'; app.use(FloatingVue);` is present in your app entry. If importing locally for `script setup`, ensure `import { VTooltip } from 'floating-vue';` is used in the component script. Remember the package name for import is `floating-vue`.Ensure `import { options } from 'floating-vue';` is at the top of your configuration file and that any modifications to `options` happen after `app.use(FloatingVue)` if you're modifying them post-installation.No dependency data recorded yet.