npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

hover-tooltip

v1.1.4

Published

A lightweight React tooltip component with smooth animations and customizable styles.

Readme

Hover Tooltip 🎯

A lightweight, customizable React tooltip component featuring smooth animations, multiple themes, and flexible positioning. Built with Framer Motion and Tailwind CSS.

Features ✨

  • 🎨 6 Beautiful Themes - Modern, Elegant, Frost, Neon, Soft, and Glass
  • 📍 Smart Positioning - Automatic positioning with 4 placement options
  • 🎬 Smooth Animations - 6 fluid animation styles powered by Framer Motion
  • 📱 Mobile Ready - Responsive design that works across all devices
  • 🌗 Dark Mode - Seamless integration with dark mode
  • 🔧 Highly Customizable - Easy styling with CSS variables and class names
  • 📦 Lightweight - Only peer dependencies required

Installation 📥

npm install hover-tooltip framer-motion

# or with yarn
yarn add hover-tooltip framer-motion

# or with pnpm
pnpm add hover-tooltip framer-motion

Quick Start 🚀

import Tooltip from "hover-tooltip";

function App() {
  return (
    <Tooltip text="Hello World!" position="top" theme="modern">
      <button>Hover me</button>
    </Tooltip>
  );
}

Examples 💡

Basic Usage

// Simple tooltip
<Tooltip text="Basic tooltip">
  <button>Hover me</button>
</Tooltip>

// With position
<Tooltip text="Bottom tooltip" position="bottom">
  <button>Hover me</button>
</Tooltip>

// With theme
<Tooltip text="Glass theme" theme="glass">
  <button>Hover me</button>
</Tooltip>

Advanced Usage

// Click trigger with persistence
<Tooltip
  text="Click-triggered tooltip"
  showOnClick
  persistent
  theme="neon"
>
  <button>Click me</button>
</Tooltip>

// Rich HTML content
<Tooltip
  text="<strong>Bold</strong> and <em>italic</em> text"
  rich
  theme="elegant"
>
  <button>Rich Content</button>
</Tooltip>

// Custom styling
<Tooltip
  text="Custom styled tooltip"
  className="my-custom-tooltip"
  animation="elastic"
>
  <button>Custom Style</button>
</Tooltip>

Props ⚙️

| Prop | Type | Default | Description | | ----------- | --------------------------------------------------------------- | -------- | ---------------------------------- | | text | string | required | Tooltip content | | children | ReactNode | required | Trigger element | | position | 'top' | 'bottom' | 'left' | 'right' | 'top' | Placement | | theme | 'modern' | 'elegant' | 'frost' | 'neon' | 'soft' | 'glass' | 'modern' | Visual theme | | animation | 'smooth' | 'pop' | 'shift' | 'elastic' | 'fade' | 'scale' | 'smooth' | Animation style | | delay | number | 0.1 | Show delay (seconds) | | duration | number | 0.3 | Animation duration | | distance | number | 8 | Distance from trigger (px) | | maxWidth | string | '250px' | Maximum width | | arrow | boolean | true | Show/hide arrow | | showOnClick | boolean | false | Click trigger | | persistent | boolean | false | Stay visible until clicked outside | | rich | boolean | false | Allow HTML content | | className | string | '' | Custom CSS classes | | fontSize | 'sm' | 'base' | 'lg' | 'sm' | Text size |

Themes 🎨

// Modern (Default)
<Tooltip theme="modern">Clean, dark theme</Tooltip>

// Elegant
<Tooltip theme="elegant">Light theme with glass effect</Tooltip>

// Frost
<Tooltip theme="frost">Frosted glass effect</Tooltip>

// Neon
<Tooltip theme="neon">Dark theme with neon borders</Tooltip>

// Soft
<Tooltip theme="soft">Subtle light theme</Tooltip>

// Glass
<Tooltip theme="glass">Modern blur effect</Tooltip>

Animations 🎬

// Smooth (Default)
<Tooltip animation="smooth">Spring animation</Tooltip>

// Pop
<Tooltip animation="pop">Scale and fade</Tooltip>

// Elastic
<Tooltip animation="elastic">Bouncy spring</Tooltip>

// Fade
<Tooltip animation="fade">Simple fade</Tooltip>

// Scale
<Tooltip animation="scale">Smooth scaling</Tooltip>

// Shift
<Tooltip animation="shift">Directional slide</Tooltip>

Styling 🎯

Custom CSS

.my-custom-tooltip {
  --tooltip-bg: #2563eb;
  --tooltip-text: #ffffff;
  --tooltip-border-radius: 8px;
  --tooltip-arrow-size: 8px;
}

Dark Mode

// Automatically adapts to dark mode
<Tooltip theme="elegant">
  <button>Dark mode ready</button>
</Tooltip>

TypeScript Support 📘

import Tooltip from "hover-tooltip";
import type { TooltipProps } from "hover-tooltip";

const MyComponent: React.FC = () => {
  return (
    <Tooltip text="TypeScript enabled" position="top" theme="modern">
      <button>Typed Props</button>
    </Tooltip>
  );
};

Troubleshooting 🔧

Common Issues

  1. Tooltip not showing

    • Verify framer-motion installation
    • Check tooltip text prop
    • Look for z-index conflicts
  2. Animation issues

    • Confirm framer-motion compatibility
    • Check for transform conflicts
  3. Styling problems

    • Verify Tailwind CSS setup
    • Check CSS specificity
    • Inspect custom theme variables

Contributing 🤝

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License 📝

MIT © Karan

Author 👨‍💻

Karan

Support ⭐

If you find this project helpful, please give it a star! ⭐