2.0.0 • Published 5 years ago

reactip v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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

propstypedefaultdescription
placementstringxplacement tooltip showup: [top, right, bottom, left]
tooltipanythingnulltooltip content, you can pass DOM node or react component
eventstringhovertrigger event: [hover, click]
offsetParentnodedocument.bodyposition will be calculated relative to this node
popupStyleobjectundefinedpopup style object

License

Reactip is released under the MIT license.

2.0.0

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

1.0.0-0

7 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago