This package has been deprecated

Author message:

WARNING: This project has been renamed to react-overlay-trigger

reactip

2.0.0 • Public • Published

Reactip

tooltip component for react.

Examples

visist https://huozhi.github.io/reactip

Usage

npm i -S react react-dom @emotion/core # for dependencies 
npm i -S reactip

NOTICE: If you don't have these dependencies above, it won't work!

Wrapp the trigger with Tooltip component

import React from 'react'
import Tooltip from 'reactip'
 
const Button = ({children, ...rest}) => (
  <button {...rest}>{children}</button>
)
 
const Demo = () => (
  <div>
    <Tooltip placement="right" tooltip="something" event="hover">
      <Button className="Button">right</Button>
    </Tooltip>
 
    <Tooltip placement="top" tooltip="something" event="click">
      <button className="Button">top</button>
    </Tooltip>
  <div>
)

API

props type default description
placement string x placement tooltip showup: [top, right, bottom, left]
tooltip anything null tooltip content, you can pass DOM node or react component
event string hover trigger event: [hover, click]
offsetParent node document.body position will be calculated relative to this node
popupStyle object undefined popup style object

License

Reactip is released under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0-0
    1

Package Sidebar

Install

npm i reactip

Weekly Downloads

12

Version

2.0.0

License

MIT

Unpacked Size

64.6 kB

Total Files

9

Last publish

Collaborators

  • huozhi