MCPcopy
hub / github.com/ReactTooltip/react-tooltip

github.com/ReactTooltip/react-tooltip @v6.0.8 sqlite

repository ↗ · DeepWiki ↗ · release v6.0.8 ↗
202 symbols 516 edges 83 files 6 documented · 3%
README

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.

Documentation for V6 - ReactTooltip.


Installation

npm install react-tooltip

or

yarn add react-tooltip

React Compatibility

react-tooltip supports React 16.14.0 and newer through peer dependencies, including React 17, 18, and 19.

The project is currently validated against React 19, but the published package remains compatible with older supported React versions.

React version Supported
16.14+ Yes
17.x Yes
18.x Yes
19.x Yes

Server Components

react-tooltip is a client-side library. It uses hooks, DOM observers, browser events, and layout measurement, so the tooltip component itself must run inside a client component boundary.

This works well in frameworks such as Next.js with Server Components, but you should render <Tooltip /> from a client component and attach your tooltip attributes or selectors from elements rendered under that client boundary.

If you are using React Server Components, the practical rule is simple:

  • server components can render the anchor markup
  • client components should render and control react-tooltip

In Next.js, the usual pattern is to export the tooltip from a small wrapper file marked with 'use client'.

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!

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.

import { Tooltip } from 'react-tooltip'

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

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.

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

4 . Include the <Tooltip /> element.

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

<Tooltip id="my-tooltip" />

Troubleshooting

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

npm install react-tooltip@latest

or

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

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

Extension points exported contracts — how you extend this code

IPosition (Interface)
(no doc)
src/components/Tooltip/TooltipTypes.d.ts
IComputePositionArgs (Interface)
(no doc)
src/utils/compute-tooltip-position-types.d.ts
Window (Interface)
(no doc)
docs/src/components/BannerSponsor/index.tsx
Window (Interface)
(no doc)
benchmarks/fixture/app.tsx
TooltipImperativeOpenOptions (Interface)
(no doc)
src/components/Tooltip/TooltipTypes.d.ts
IComputedPosition (Interface)
(no doc)
src/utils/compute-tooltip-position-types.d.ts
BannerSponsorProps (Interface)
(no doc)
docs/src/components/BannerSponsor/index.tsx
TooltipImperativeCloseOptions (Interface)
(no doc)
src/components/Tooltip/TooltipTypes.d.ts

Core symbols most depended-on inside this repo

waitForTooltip
called by 35
src/test/test-utils.js
hoverAnchor
called by 22
src/test/test-utils.js
clearTimeoutRef
called by 20
src/utils/clear-timeout-ref.ts
deepEqual
called by 19
src/utils/deep-equal.ts
injectStyle
called by 19
src/utils/handle-style.ts
advanceTimers
called by 18
src/test/test-utils.js
flushMicrotasks
called by 14
src/test/test-utils.js
nextFrame
called by 11
benchmarks/fixture/app.tsx

Shape

Function 173
Interface 12
Method 11
Class 6

Languages

TypeScript100%

Modules by API surface

src/components/Tooltip/anchor-registry.ts15 symbols
src/components/Tooltip/use-tooltip-events.tsx14 symbols
src/test/test-utils.js11 symbols
benchmarks/run-benchmark.mjs11 symbols
benchmarks/aggregate-benchmarks.mjs11 symbols
src/test/tooltip-observers.spec.js10 symbols
benchmarks/fixture/app.tsx10 symbols
benchmarks/run-scaling-series.mjs9 symbols
example/src/App.js8 symbols
src/test/tooltip-imperative.spec.js6 symbols
src/test/mutation-observer-test-utils.js6 symbols
src/components/Tooltip/event-delegation.ts5 symbols

Dependencies from manifests, versioned

@docusaurus/core3.10.0 · 1×
@docusaurus/module-type-aliases3.10.0 · 1×
@docusaurus/preset-classic3.10.0 · 1×
@docusaurus/tsconfig3.10.0 · 1×
@floating-ui/dom1.7.6 · 1×
@mdx-js/react3.1.1 · 1×
@rollup/plugin-commonjs29.0.2 · 1×
@rollup/plugin-node-resolve16.0.3 · 1×
@rollup/plugin-replace6.0.3 · 1×
@rollup/plugin-typescript12.3.0 · 1×
@testing-library/dom10.4.1 · 1×
@testing-library/jest-dom6.9.1 · 1×

For agents

$ claude mcp add react-tooltip \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact