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

@storepress/tooltip

v0.9.0

Published

StorePress ToolTip Plugin

Readme

Simple Tooltip By StorePress

It's a lightweight, dependency-free JavaScript solution for creating dynamic, configurable tooltips on web pages. The library is initialized declaratively via "data-*" attributes and can be controlled programmatically through a simple JavaScript API and custom events.

Features

  • Declarative Setup: Easily add tooltips directly in your HTML using data-* attributes.

  • Dynamic Positioning: Automatically adjusts tooltip position (top/bottom) and handles horizontal overflow to stay within the viewport.

  • CSS-Driven: The plugin calculates positioning but relies on your CSS for the actual appearance, giving you full control over styling.

  • JavaScript API: Provides a simple API to initialize, destroy, re-initialize, and get instances of tooltips.

  • Support prefers-reduced-motion for accessibility.

  • Support RTL.

Basic Usage

The easiest way to use the library is by adding the data-storepress-tooltip attribute to any HTML element. The plugin will automatically detect and initialize these elements on DOMContentLoaded.

The content of the tooltip is defined using the CSS content property on the ::before or ::after pseudo-element.

HTML

Add the data-storepress-tooltip attribute to an element. You can set the tooltip's text using another data attribute, like data-tooltip-text, which we'll use in the CSS.

<button type="button" data-storepress-tooltip="This is a tooltip!">Hover over me</button>

<a href="#" data-storepress-tooltip="Another tooltip here.">Or me!</a>

<div class="storepress-tooltip-type-image" style="--tooltip-image: url('images/sample.jpg')" data-storepress-tooltip="Monotone ctallysyndicatemarketpositioning.">Text</div>

Local Usages

  • npm install
  • npm run build
  • Load ./build/style-tooltip.css
  • Load ./build/storepress-utils.js
  • Load ./build/tooltip.js
  • Add data-storepress-tooltip="Tooltip Text" attribute on any HTML element.
  • Add data-storepress-tooltip="Image Tooltip Text" and class="storepress-tooltip-type-image" and style="--tooltip-image: url('images/sample.jpg')" attribute on any HTML element for image tooltip.

Development

  • npm start
  • Please check ./src/style.scss
  • Please check ./src/index.js

Package Usages

npm i @storepress/tooltip @storepress/utils --save

Let's create tooltip from HTML Attribute data-storepress-tooltip.

<span data-storepress-tooltip="Tooltip Contents">For Text Tooltip</span>
<span class="storepress-tooltip-type-image" style="--tooltip-image: url('images/sample.jpg')" data-storepress-tooltip="Tooltip Contents"> For Image tooltip </span>

Create custom-tooltip.scss file

@charset "UTF-8";

@use "~@storepress/tooltip/src/mixins" as plugin;

:where([data-storepress-tooltip]) {
  // $content-attribute is for tooltip text attribute.
  @include plugin.init("data-storepress-tooltip");
}

// Changing colors
// See: "~@storepress/tooltip/src/mixins" variables() mixins.
[data-storepress-tooltip] {
  --tooltip-text-color: #ffffff;
  --tooltip-background-color: #e31616;
}

Create scripts.js file

/**
 * External dependencies
 */
import StorePressTooltip from '@storepress/tooltip'

document.addEventListener('DOMContentLoaded', () => {
  StorePressTooltip.init()
})

Reload and Destroy

/**
 * External dependencies
 */
import StorePressTooltip from '@storepress/tooltip'

document.addEventListener('DOMContentLoaded', () => {
  StorePressTooltip.reload()
})

document.addEventListener('DOMContentLoaded', () => {
  StorePressTooltip.destroy()
})

Control from external script

/**
 * External dependencies
 */
import { getStorePressPlugin } from '@storepress/utils'

// getStorePressPlugin is also available globally by: StorePress.Utils.getStorePressPlugin

document.getElementById('custom-button').addEventListener('click', () => {
  const Tooltip = getStorePressPlugin('tooltip')
  Tooltip.destroy()
  Tooltip.init()
  
  Tooltip.setup()
  Tooltip.clear()
})


const $tooltips1 = StorePress.Utils.getPluginInstance('li.item', 'tooltip')
const $tooltips2 = StorePress.Utils.getStorePressPlugin('tooltip').get('li.item')
const $tooltips3 = StorePress.Utils.getStorePressPlugin('tooltip').get()

Publish

  • Add Tag - git tag $(node -p "require('./package.json').version") && git push origin "$_"
  • Delete Tag - git tag -d $(node -p "require('./package.json').version") && git push origin --delete "$_"
  • Publish - npm publish