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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@topmarksdevelopment/hover-box

v2.0.1

Published

A compact tool to reveal information on hover

Downloads

5

Readme

Hover Box (A JavaScript package)

A simple package to reveal some extra information on hover

Links

Usage

Add the below to your code to your project and you're away

Note: by default, we're listening upon construction

const hb = new HoverBox(".HoverBox");
const hbWithOptions = new HoverBox(".HoverBox", options); // if you have options

// Inside some other functions somewhere
hb.startListening();
hb.stopListening();

Options

setMy?: alignment

The part of the popup linked to at
Default: top center

at?: alignment

The part of the anchor setMy will "attach" to
Default: bottom center

keepOpen?: boolean

If the mouse moves into the popup, keep the pop-up open
Default: true

allowHtml?: boolean

The text provided can be treated as safe HTML
Default: false

transitionDelay?: number

The delay before we start the transition (in milliseconds)
Default: 333

transitionDuration?: number

A link to the transition duration (in milliseconds). This must match the CSS transition property or the element
Default: 333

collision?: CollisionHandler

How to handle the popup colliding with the window edge
Default: bestfit
Note: This is just passed straight to the underlying Position module

bestFitPreference?: horizontal OR vertical

The preferred direction to try bestfit first
Default: horizontal
Note: This is just passed straight to the underlying Position module

defaults?: { my: alignment, at: alignment }

The fallback values when only one property is supplied, or the property supplied is invalid
Default: Same as setMy & at respectively
Note: This is just passed straight to the underlying Position module

Types

The Alignment type

The Alignment will allow any of the below, plus a combination in the form vertical horizontal (e.g. top center, bottom right or center left)

  • top
  • bottom
  • center
  • left
  • right

Using a single value will default the other to center so left == center left

The CollisionHandler type

How to handle any collisions, either:

  • bestFit: find the best fit before trying to flip the element
  • flipFit: flip the element completely vertically and horizontally
  • ignore: ignore any collisions and just carry on