项目作者: wwayne

项目描述 :
react tooltip component
高级语言: JavaScript
项目地址: git://github.com/wwayne/react-tooltip.git
创建时间: 2015-04-07T13:15:04Z
项目社区:https://github.com/wwayne/react-tooltip

开源协议:MIT License

下载


react-tooltip

Version
typescript
code style: prettier
npm download
minified
minified gzip

If you like the project, please give the project a GitHub 🌟


Why do we show ads on our docs?

  • ReactTooltip is an open source project, this is the way we found to be financed by the community.

Demo

Edit ReactTooltip

Documentation for V4 - Github Page.

Documentation for V5 - ReactTooltip.


Installation

  1. npm install react-tooltip

or

  1. yarn add react-tooltip

Sponsors

Gold Sponsors 🌟


Frigade

React Tooltip is proud to be sponsored by Frigade, a developer tool for building better product onboarding: guided tours, getting started checklists, announcements, etc.

Silver Sponsors ✪

Powered by





Usage

1 . Import the CSS file to set default styling.

[!WARNING]\
If you are using a version before than v5.13.0, you must import the CSS file or the tooltip won’t show!

  1. import 'react-tooltip/dist/react-tooltip.css'

This needs to be done only once and only if you are using a version before than 5.13.0. We suggest you do it on your src/index.js or equivalent file.

2 . Import react-tooltip after installation.

  1. import { Tooltip } from 'react-tooltip'

or if you want to still use the name ReactTooltip as V4:

  1. import { Tooltip as ReactTooltip } from 'react-tooltip'

3 . Add data-tooltip-id="<tooltip id>" and data-tooltip-content="<your placeholder>" to your element.

data-tooltip-id is the equivalent of V4’s data-for.

  1. <a data-tooltip-id="my-tooltip" data-tooltip-content="Hello world!">
  2. ◕‿‿◕
  3. </a>

4 . Include the <Tooltip ></Tooltip> element.

[!NOTE]\
Don’t forget to set the id, it won’t work without it!

  1. <Tooltip id="my-tooltip" ></Tooltip>

Troubleshooting

Before trying these, make sure you’re running the latest ReactTooltip version with

  1. npm install react-tooltip@latest

or

  1. yarn add react-tooltip@latest

Please check our troubleshooting section on our docs.

If you can’t find your problem here, make sure there isn’t an open issue already covering it.
If there isn’t, feel free to submit a new issue.

Article

@wwayne_me/how-i-insert-sass-into-my-npm-react-component-b46b9811c226#.gi4hxu44a">How I insert sass into react component

Maintainers

danielbarion Maintainer - Creator of React Tooltip >= V5.

gabrieljablonski Maintainer.

aronhelser (inactive).

alexgurr (inactive).

pdeszynski (inactive).

roggervalf (inactive).

huumanoid (inactive)

wwayne (inactive) - Creator of the original React Tooltip (V1.x ~ V4.x.)

We would gladly accept a new maintainer to help out!

Contributing

We welcome your contribution! Fork the repo, make some changes, submit a pull-request! Our contributing doc has some details.

License

MIT