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

easy-tooltips

v1.4.3

Published

A lightweight, zero-dependency tooltip library using modern JavaScript and CSS.

Readme

easy-tooltips

A lightweight, zero-dependency tooltip library using modern JavaScript and CSS.
Just add data-tooltip to any element! No setup or config required.

npm version License: MIT

Live Demo

Features

  • No dependencies
  • Works with both mouse and touch
  • Customizable via CSS variables
  • Automatically repositions and shifts to fit the screen
  • Smooth, non-interrupting animations (no flicker on rapid hover)
  • Compatible with Vue, React, Svelte, and more

Quick Start

Install via npm

npm install easy-tooltips
import "easy-tooltips/styles.css"
import "easy-tooltips"

Or use via CDN

https://www.jsdelivr.com/package/npm/easy-tooltips

Add tooltips to your HTML

<button data-tooltip="Click to save your changes">Save</button>
<span data-tooltip="This field is required">Username *</span>
<div data-tooltip="Multi-line tooltips<br>are supported too">Info</div>

No additional setup is needed for Vue, React, Svelte, or other frameworks! Tooltips automatically update when the element updates!

Advanced Usage

Custom HTML

You can render custom HTML inside a tooltip using data-tooltip-src. The value can be either a CSS selector or the literal keyword next.

The matched element's content is copied into the tooltip.

Using a CSS selector Point to any element in the document.

<button data-tooltip-src="#tip-shipping">Shipping info</button>
<template id="tip-shipping">
  <strong>Free shipping</strong> on orders over £50<br>
  Delivered in 2 to 4 working days
</template>

Using next Use next to automatically pull content from the next DOM element. The source element is automatically hidden.

<button data-tooltip-src="next">Ingredients</button>
<div>
  <ul>
    <li>Oats</li>
    <li>Honey</li>
    <li>Sea salt</li>
  </ul>
</div>

Custom tooltip IDs

For styling specific tooltips:

<button data-tooltip="Special tooltip" data-tooltip-id="save-button">Save</button>
#save-button {
  --tooltip-background: #28a745;
  --tooltip-border-color: #1e7e34;
}

Customization

You can style tooltips using CSS variables (recommended) or by targeting the tooltip classes directly. Note that some CSS variables are required for proper positioning:

:root {
  /* Tooltip appearance */
  --tooltip-background: #fff;         /* Background color */
  --tooltip-border-color: #aaa;       /* Border color */
  --tooltip-border-size: 1px;         /* Border thickness */
  --tooltip-max-width: 100%;          /* Maximum tooltip width */
  
  /* Positioning (required for JS positioning) */
  --tooltip-vertical-distance: 16px;  /* Distance from trigger element */
  --tooltip-viewport-padding: 16px;   /* Minimum distance from screen edges */
  --tooltip-arrow-size: 12px;         /* Size of the arrow */
  --tooltip-arrow-edge-buffer: 12px;  /* How close the arrow can get to the edge of a tooltip */
  --tooltip-arrow-radius: 0;          /* Border radius of the arrow */
  
  /* Animation (required for JS timing) */
  --tooltip-animation-length: 0.15s;  /* Duration of fade animation */
  --tooltip-delay: 0.15s;             /* How long before the animation starts */
}

How it works

Easy-tooltips uses a smart positioning system that:

  1. Detects viewport boundaries - Automatically positions tooltips above or below elements
  2. Handles edge cases - Shifts tooltips horizontally when they would overflow the screen
  3. Manages animations - Queues tooltip updates to prevent conflicts

License

MIT © Ewan Howell