You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@trendmicro/react-tooltip

Package Overview
Dependencies
3
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trendmicro/react-tooltip

React Tooltip


Version published
Maintainers
4
Created

Readme

Source

react-tooltip build status Coverage Status

NPM

React Tooltip

Demo: https://trendmicro-frontend.github.io/react-tooltip

Installation

  1. Install the latest version of react and react-tooltip:
npm install --save react @trendmicro/react-tooltip
  1. At this point you can import @trendmicro/react-tooltip and its styles in your application as follows:
import { Tooltip, Infotip } from '@trendmicro/react-tooltip';

// Be sure to include styles at some point, probably during your bootstraping
import '@trendmicro/react-tooltip/dist/react-tooltip.css';

Usage

// Right tooltip
<Tooltip content="Config settings">
    <button>Settings</button>
</Tooltip>

// Right tooltip with a function content
<Tooltip
    content={() => {
        return (<span style={{ whiteSpace: 'nowrap' }}>{'Right tooltip'}</span>);
    }}
>
    <sapn>Hover on me</span>
</Tooltip>

// Top tooltip
<Tooltip placement="top" content="Top tooltip"><sapn>Hover on me</span></Tooltip>
// Infotip
<Infotip content="This is a simple example for infotip.">
    <span className="icon icon-info-sign" />
</Infotip >

<Infotip placement="rightTop" content="This is a simple example for infotip.">
    <span className="icon icon-info-sign" />
</Infotip >

<Infotip
    tooltipStyle={{ wordWrap: 'break-word' }}
    content="Pneumonoultramicroscopicsilicovolcanoconiosis is the longest word. Start01234567890123456789012345678901234567890123456789012345678901234567890123456789End Start0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789End"
>
    <span>Hover on me (infotip with long article)</span>
</Infotip>

API

Properties for Tooltip

NameTypeDefaultDescription
placementstring'right'One of: 'top', 'right', 'bottom' and 'left'.
Tooltip will display at placement if possible, otherwise tooltip adjust it's location automatically.
enterDelaynumber0The delay length (in ms) before the tooltip appears.
leaveDelaynumber0The delay length (in ms) before the tooltip disappears.
hideOnClickbooleanfalseHide tooltip when target been clicked.
disabledbooleanfalseDisable tooltip.
tooltipClassNamestringThe className apply to tooltip itself. You can use it to override style if need.
tooltipStyleobjectThe style apply to tooltip itself. You can use it to override style if need.
contentnode or functionThe tooltip content. Required.

Properties for Infotip

NameTypeDefaultDescription
placementstring'rightBottom'One of: 'rightTop', 'rightBottom', 'leftTop', and 'leftBottom'.
Tooltip will display at placement if possible, otherwise tooltip adjust it's location automatically.
enterDelaynumber0The delay length (in ms) before the infotip appears.
leaveDelaynumber0The delay length (in ms) before the infotip disappears.
hideOnClickbooleanfalseHide infotip when target been clicked.
disabledbooleanfalseDisable infotip.
tooltipClassNamestringThe className apply to infotip itself. You can use it to override style if need.
tooltipStyleobjectThe style apply to infotip itself. You can use it to override style if need.
contentnode or functionThe infotip content. Required.

License

MIT

Keywords

FAQs

Package last updated on 16 May 2018

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc