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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@spider-ui/tooltip

v0.2.7

Published

Bare tooltip web element.

Readme

@spider-ui/tooltip

Create an accessible tooltip on an any element. The tooltip will show on focus or hover.

Usage

To use the element, use the spider-tooltip tag, and pass in your slotted elements:

<spider-tooltip>
  <button slot="trigger">Learn More</button>
  <div slot="content">You've already learned too much.</div>
</spider-tooltip>

Install

@spider-ui/tooltip requires minimal set up with either npm or the distribution code.

npm

Install the package and its peer dependencies:

$ npm i @spider-ui/tooltip @spider-ui/global-event-registry upgraded-element

Then import the element in your JavaScript:

import "@spider-ui/tooltip"

Bundle

If you don't want to use npm, you can grab the source from jsdelivr CDN. Similar to npm, you'll need to add script links to @spider-ui/global-event-registry and upgraded-element before tooltip.

<!-- Use the unminified bundle in development -->
<script
  type="text/javascript"
  src="https://cdn.jsdelivr.net/npm/@spider-ui/[email protected]/dist/tooltip.js"
  integrity="sha256-0zfwh3NHZMAu+HbXEKttDolp/L+odlcPs2Z5CNCbK0o="
  crossorigin="anonymous"
></script>

<!-- Or use the minified/uglified bundle in production -->
<script
  type="text/javascript"
  src="https://cdn.jsdelivr.net/npm/@spider-ui/[email protected]/dist/tooltip.min.js"
  integrity="sha256-tV1z5exT+o2BkfsYdhUInd8bzkVghuuYaRK/7iqqwaY="
  crossorigin="anonymous"
></script>

Then you're good to go!

Controlling Visibility

Because slotted elements aren't hidden in the DOM on first render, you may see your tooltip's unstyled content on page load. You can fix around this by adding the following to your app's stylesheet:

spider-tooltip:not(:defined) {
  display: none;
}

Unfortunately, however, this won't work in IE 11.

Attributes

position

Configures which side of the trigger to show the tooltip.Default: "block-start"Accepted Values: "block-start" | "block-end" | "inline-start" | "inline-end"

<spider-tooltip position="inline-end">...</spider-tooltip>

show-arrow

Configures the tooltip to show an arrow pointing to the trigger.

<spider-tooltip show-arrow>...</spider-tooltip>

mode

Configures the base visual theme of the tooltip.Default: "dark".Accepted Values: "dark" | "light".

<spider-tooltip mode="light">...</spider-tooltip>

delay-on

Configures a custom show delay duration (in milliseconds) for the tooltip.

<spider-tooltip delay-on="500">...</spider-tooltip>

delay-off

Configures a custom hide delay duration (in milliseconds) for the tooltip.

<spider-tooltip delay-off="500">...</spider-tooltip>

delay

Configures both the delay-on and delay-off delay durations of the tooltip. Use delay-on and delay-off to override the show and hide delay durations, respectively.Default: "300".

<spider-tooltip delay="500">...</spider-tooltip>

Slots

trigger

The trigger element for the tooltip. This can be any element, but it's recommended to be a focusable element (e.g., a button) for better accessibility.

content

The content of the tooltip. It's recommended to use a basic div or span as the slotted element.