react-popper-tooltip is a React library that provides a flexible hook (`usePopperTooltip`) for creating smart, accessible tooltips, popovers, and overlays. It leverages the robust positioning engine of `react-popper` (which in turn uses `popper.js`) under the hood. Currently at version 4.4.2, the library shows an active release cadence with frequent patch and minor updates addressing bugs and adding features like Shadow DOM support and improved hover mechanics. A key differentiator since its v4 release is the exclusive reliance on a hook-based API, moving away from older render prop patterns for a more modern and flexible developer experience. It provides optional default styling but is designed to be highly customizable with any CSS or CSS-in-JS solution.
npm install react-popper-tooltipVerified import paths — ran on the pinned version, not inferred.
Demonstrates the basic usage of the `usePopperTooltip` hook with a simple button trigger and includes the default stylesheet for minimal styling and functionality.
Migrate any existing `TooltipTrigger` implementations to use the `usePopperTooltip` hook. Consult the official migration guide for detailed instructions and examples.
Ensure you are using `react-popper-tooltip` version `4.2.0` or higher to benefit from the stable hover trigger implementation and avoid known bugs from the `4.1.x` releases.
For users on v3.x, consult the archived documentation at `https://github.com/mohsinulhaq/react-popper-tooltip/blob/v3/README.md`. For new projects or upgrades, use v4.x and the `usePopperTooltip` hook.
Add `import 'react-popper-tooltip/dist/styles.css';` to your application's entry file, or define custom CSS rules targeting the `tooltip-container` and `tooltip-arrow` classes, leveraging `data-popper-placement` attributes for positional styling.
Migrate your tooltip implementation to use the `usePopperTooltip` hook instead of `TooltipTrigger`.
Ensure `usePopperTooltip` is imported as a named export: `import { usePopperTooltip } from 'react-popper-tooltip';`.Add `import 'react-popper-tooltip/dist/styles.css';` to your project's entry point, or apply custom CSS to elements with `className='tooltip-container'` and `className='tooltip-arrow'`.