GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - react-component/tooltip: 💡 Positioned React tooltip for hover, focus, click, and controlled popup flows.

BranchesTags
Open more actions menu

Latest commit

 

History

343 Commits
343 Commits

Folders and files

NameName
Last commit message
Last commit date
.dumi
.dumi
 
 
.github
.github
 
 
.husky
.husky
 
 
assets
assets
 
 
docs
docs
 
 
src
src
 
 
tests
tests
 
 
.dumirc.ts
.dumirc.ts
 
 
.editorconfig
.editorconfig
 
 
.fatherrc.js
.fatherrc.js
 
 
.fatherrc.ts
.fatherrc.ts
 
 
.gitignore
.gitignore
 
 
.prettierignore
.prettierignore
 
 
.prettierrc
.prettierrc
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
README.zh-CN.md
README.zh-CN.md
 
 
eslint.config.mjs
eslint.config.mjs
 
 
global.d.ts
global.d.ts
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
type.d.ts
type.d.ts
 
 
vercel.json
vercel.json
 
 

Repository files navigation

@rc-component/tooltip

Ant Design Part of the Ant Design ecosystem.

💡 Positioned React tooltip for hover, focus, click, and controlled popup flows.

NPM version npm downloads build status Codecov bundle size dumi

English | 简体中文

Highlights

  • Supports hover, focus, click, and controlled visibility through one trigger layer.
  • Provides built-in placements, custom alignment, delays, arrows, and popup motion.
  • Exposes semantic classNames and styles slots for root, arrow, and container nodes.
  • Keeps accessibility wiring through generated tooltip ids and aria-describedby.

Install

npm install @rc-component/tooltip

Usage

import Tooltip from '@rc-component/tooltip';
import '@rc-component/tooltip/assets/bootstrap_white.css';

export default () => (
  <Tooltip placement="top" overlay={<span>Tooltip content</span>}>
    <button type="button">Hover me</button>
  </Tooltip>
);

Online preview: https://tooltip.react-component.vercel.app/

Examples

Run the local dumi site:

npm install
npm start

Then open http://localhost:8000.

API

Tooltip

Name Type Default Description
afterVisibleChange (visible: boolean) => void - Called after popup visibility changes.
align AlignType {} Extra popup alignment config.
arrowContent React.ReactNode - Custom arrow content.
builtinPlacements TriggerProps['builtinPlacements'] built-in placements Placement map passed to trigger.
children React.ReactElement - Required trigger element.
classNames Partial<Record<SemanticName, string>> - Semantic class names for root, arrow, and container nodes.
defaultVisible boolean - Initial uncontrolled visible state.
destroyOnHidden boolean false Destroy popup DOM when hidden.
disabled boolean false Temporarily hide tooltip while preserving visible state.
fresh boolean - Keep popup content fresh when closed.
getTooltipContainer (node: HTMLElement) => HTMLElement - Resolve popup container.
id string generated id Tooltip id used for accessibility.
motion TriggerProps['popupMotion'] - Popup motion config.
mouseEnterDelay number 0 Delay in seconds before showing on mouse enter.
mouseLeaveDelay number 0.1 Delay in seconds before hiding on mouse leave.
onPopupAlign TriggerProps['onPopupAlign'] - Called after popup alignment.
onVisibleChange (visible: boolean) => void - Called when visibility changes.
overlay React.ReactNode | () => React.ReactNode - Tooltip content.
placement string 'right' Popup placement.
prefixCls string 'rc-tooltip' Prefix class name.
showArrow boolean | ArrowType true Whether to show arrow or provide arrow config.
styles Partial<Record<SemanticName, React.CSSProperties>> - Semantic styles for root, arrow, and container nodes.
trigger ActionType | ActionType[] ['hover'] Actions that show the tooltip.
unique TriggerProps['unique'] - Experimental unique container reuse config.
visible boolean - Controlled visible state.
zIndex number - Popup z-index.

Development

npm install
npm start
npm test
npm run tsc
npm run compile
npm run build

The dumi site runs at http://localhost:8000 by default.

Release

npm run prepublishOnly

The release flow is handled by @rc-component/np through the rc-np command after the package build.

License

@rc-component/tooltip is released under the MIT license.

About

💡 Positioned React tooltip for hover, focus, click, and controlled popup flows.

react-component.github.io/tooltip

Topics

ant-designantdjavascriptreactreact-component

Resources

Readme
MIT license
Activity
Custom properties

Stars

944 stars

Watchers

26 watching

Forks

200 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.