Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-tooltip-lite

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-tooltip-lite

React tooltip, focused on simplicity and performance

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
decreased by-7.22%
Maintainers
2
Weekly downloads
 
Created
Source

React tooltip-lite

A lightweight and responsive tooltip. Currently only this is only activated by mouseover/out but we'll be adding focus and other events as needed. Feel free to Post an issue if you're looking to support more use cases.

Getting started

1. Install with NPM
$ npm install react-tooltip-lite

2. Import into your react Component
import Tooltip from 'react-tooltip-lite';

3. Wrap any element with the Tooltip component to make it a target
<Tooltip content="Go to google">
    <a href="http://google.com"> edge</a>
</Tooltip>

Props

You can pass in props to define tip direction, styling, etc. Content is the only required prop.

NameTypeDescription
contentnode (text or html)the contents of your hover target
tagNamestringhtml tag used for className
directionstringthe tip direction, defaults to up
classNamestringcss class added to the rendered wrapper
backgroundstringbackground color for the tooltip contents and arrow
colorstringtext color for the tooltip contents
paddingstringpadding amount for the tooltip contents (defaults to '10px')
stylesobjectstyle overrides for the target wrapper
eventOnstringfull name of supported react event to show the tooltip, e.g.: 'onClick'
eventOffstringfull name of supported react event to hide the tooltip, e.g.: 'onClick'
eventOnstringfull name of supported react event to toggle the tooltip, e.g.: 'onClick'
useHoverbooleanwhether to use hover to show/hide the tip

Here's an example using more of the props:

<Tooltip
  content={(
      <div>
          <h4 className="tip-heading">An unordered list to demo some html content</h4>
          <ul className="tip-list">
              <li>One</li>
              <li>Two</li>
              <li>Three</li>
              <li>Four</li>
              <li>Five</li>
          </ul>
      </div>
  )}
  direction="right"
  tagName="span"
  className="target"
>
    Target content for big html tip
</Tooltip>

To see more usage examples, take look at the /example folder in the source.

Keywords

FAQs

Package last updated on 06 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc