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

css-only-tooltip

v1.1.2

Published

basic css only tooltip

Downloads

66

Readme

css-only-tooltip

A very lightweight tooltip utitlity library, made using only CSS with dynamic light and dark themes.

Node.js Package NPM downloads License minified size npm version Css language share

Alt Text

Insatallation

  • Using npm
    $ npm install css-only-tooltip

  • Using yarn
    $ yarn add css-only-tooltip

  • Using jsDelivr CDN

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/css-only-tooltip@latest/dist/styles.min.css">
  • Using unpkg CDN:

    <link rel="stylesheet" href="https://unpkg.com/css-only-tooltip@latest/dist/styles.min.css">

Quick start

css-only-tooltip uses only data html attribute for working. So, the only step is to import the CSS in your file and use it.

When using CDN:-

Add the CDN link in your HTML file inside the <head> tag. And then pass the tooltip text in format:

<!DOCTYPE  html>
 <head>
   <!-- Add the CDN link -->
   <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/styles.min.css">
</head>

<body>
   <div class="container">
     <p data-css-only-tooltip="Tooltip 1">Text</p>
   </div>
</body>
</html>

When using Package Manger (NPM/Yarn):-

Import the styleSheet into the main root level component of the App. (for eg. in App.js in React App)

import 'css-only-tooltip/dist/styles.min.css';

Now, add the text in the data attribute in the child components.

<span data-css-only-tooltip="Hello from tooltip">Hover on me to see the tooltip</span>

Customization

There are customization options provided.
Provide the customization options in a space seperated string in the data attribute like this:-

<p data-css-only-props="customization options">

Options:

Thre are some optional customization options are available.

  • Positions:

    There are four positions provided. Bottom is default option.
    • top
    • right
    • bottom
    • left
  • Themes:

    This supports the user device's theme dynamically. There's no need to specify theme spereately. Beside this, there are two theme options provided for customization. light is default option.
    • dark
    • light

|Option| Values | default | Required | |--|--|--|--| | Position | top, right, bottom, left | bottom | No | |Theme|light, dark|light|No|

Examples:

  • dark theme, right side.
    <span 
      data-css-only-tooltip="Tooltip 2 bottom" 
      data-css-only-tooltip-props="light bottom">
       Dakr tooltip on right side
    </span>

Play with it live:-
Edit css-only-tooltip-Demo