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

react-power-tooltip

v1.0.2

Published

A powerful tooltip and menu component library for react.

Downloads

3,225

Readme

React-power-tooltip

Travis (.org) Coveralls github branch npm bundle size (minified + gzip)

A powerful and elegant alternative for all your tooltips and menu needs.

  • Different Types - For every use context: Choose between Hoverable, Static & Alert tooltips.
  • Fully Customizable - Easily change default settings via props
  • Reliable Positioning - Align your tooltip to your target element with ease
  • Advanced Customization - Add your own animations and styles via separate CSS files

DEMO

Check out the documentation & demo pages to to see all use cases.

Installation

NPM

npm install react-power-tooltip

Usage

import React, { Component } from "react";
import Tooltip from "react-power-tooltip";

class Example extends Component {
    state = {
        show: false
    }

    showTooltip = bool => {
        this.setState({ show: bool })
    }
    render() {
        return (
            <div 
                style={{ position: 'relative' }}
                onMouseOver={() => this.showTooltip(true)} 
                onMouseLeave={() => this.showTooltip(false)}
            >
                <Tooltip show={this.state.show}>
                    <span>Option 1</span>
                    <span>Option 2</span>
                </Tooltip>
            </div>
        );
    }
}
export default Example;

API

| Props | Types / Options | Default | Description | | --------------- | --------------------------------------------------------- | ------------------- | ----------------------------------------------------------------------- | | show | bool: false, true | false | Mount tooltip if true. | | fontFamily | string: font family | 'inherit' | Font family of text | | fontSize | string: px | 'inherit' | Font size of text | | fontWeight | string | 'bold' | Font weight of text | | color | string | 'inherit' | Font color of text | | animation | string: fade or bounce | 'fade' | Mount/Unmount anmation. Custom animations: See advanced usage examples. | | hoverBackground | string: hex colors | '#ececec' | Background color on hover | | hoverColor | string: hex colors | '#000000' | Font color on hover | | backgroundColor | string: hex colors | '#ffffff' | Background color | | alert | string: rgb colors | false | Pulse animation | | textBoxWidth | string: px or auto | '150px' | Width of the text box | | padding | string: px | '15px 20px' | Padding of text | | borderRadius | string: px | '5px' | Radius of corners | | zIndex | string: number | '100' | Z-index of tooltip | | moveDown | string: px | '0px' | Downward position adjustment | | moveRight | string: px | '0px' | Right position adjustment | | static | boolean: false or true | false | Disable hover animations | | flat | boolean: false or true | false | Disable shadows | | lineSeparated | boolean: false or true or string: css border property | '1px solid #ececec' | Enable ∓ specify line separation between options | | arrowAlign | string: 'start' or 'center' or 'end' | 'start' | Positions arrow relative to textbox | | position | string: 'position1 position2' | 'right center' | Positions tooltip relative to target element |

Development

You're welcome to contribute to react-power-tooltip.

To set up the project:

  1. Fork and clone the repository
  2. $ npm install
  3. $ npm run dev

The demo page will then be served on http://localhost:8000/ in watch mode, meaning you don't have refresh the page to see your changes.

Contributors

License

MIT