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

ngx-tooltip-ease

v0.0.1

Published

ngx-tooltip-ease is an Angular library providing a lightweight, performant, and responsive tooltip. This library supports custom and build-in animations, multiple lines tooltip, and a custom offset space.

Downloads

10

Readme

ngx-tooltip-ease

Description

ngx-tooltip-ease is an Angular library providing a lightweight, performant, and responsive tooltip. This library supports custom and build-in animations, multiple lines tooltip, and a custom offset space.

Support Angular version starts at v17.

Demo

Live demonstration of the ngx-tooltip-ease library here.

Installation

You can install the library using the following command:

npm i ngx-tooltip-ease

Import the stylesheet in your styles.css: @import "../node_modules/ngx-tooltip-ease/src/lib/tooltip.css";

Add the TooltipDirective to your module or standalone component.

Usage

This library consists in a directive and its options to add in the template:

<button ngxTooltip content="Hello!" animation="going-down">Ngx-tooltip-ease</button>

| Option | Default | Description | | ----------- | ---------------- | ---------------------------------------------------------------------------------------------------------- | | content | | Set the content of your tooltip. Supports multi-lines tooltip by adding /n where you want a line return. | | disable | false | Disable the tooltip. No tooltip will be shown. | | position | top | Set the position of the tooltip. Accepts: top or bottom. | | animation | scale-up fade-in | Set the keyframes animations. Multiple animations should be separated with a space. | | animationFn | ease-out | Set the timing function of the animation. Value: 'ease', 'ease-in', 'ease-out', cubic-bezier, ... | | animationMs | 200 | Set the duration of the animation in ms. | | offsetSpace | 5 | Define in pixels the offset space between the hosting element and the tooltip. |

Responsive

This library is responsive and will adapt its position based on the available space. If the width of the tooltip is greater than the window width, a truncated tooltip with an ellipsis will appear. Responsiveness comes without attaching a resize event.

Ready-to-use animations keyframes

This library comes with build-in and ready-to-use animations keyframes to animate the opening menu. Just fill in the name, duration and easing function (more info on the animation CSS shorthand here).

You have the choice for the opening menu animation between no animations, any following build-in animations, or creating your own keyframes.

@keyframes scale-up {
  from {
    transform: scale(0.9);
  }
  to {
    transform: scale(1);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes going-down {
  from {
    transform: translateY(-10%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes going-up {
  from {
    transform: translateY(10%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes going-left {
  from {
    transform: translateX(10%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes going-right {
  from {
    transform: translateX(-10%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes scale-up-bottom {
  from {
    transform: scale(0.9);
    transform-origin: bottom;
  }
  to {
    transform: scale(1);
    transform-origin: bottom;
  }
}
@keyframes scale-up-top {
  from {
    transform: scale(0.9);
    transform-origin: top;
  }
  to {
    transform: scale(1);
    transform-origin: top;
  }
}

Style customisation

Instead of changing style through a dedicated API with limited options, this library let the total control over the styling possibilities to the user. (Recommanded) To change default styles, create a new .css (or preprocessor) file, and import it in your styles.css file at root. The class to override is ngx-tooltip attached to a paragraph element.

header p.ngx-tooltip {
  background: #000;
  color: gold;
  font-family: "Allura";
  font-size: 1.1rem;
}

Change log

Report a Bug

Please provide a detailed description of the encountered bug, including your options and the steps/actions that led to the issue. An accurate description will help me to reproduce the issue.

Ngx-ease serie

You like this library? Discover the ngx-ease serie here.