JGuang

Tooltip

Tooltip · Arco Design

Preview
npm install @arco-design/web-react@2.66.18

Tooltip

A simple text popup tip.

Install

npm install @arco-design/web-react@2.66.18

Import @arco-design/web-react/dist/css/arco.css at the entry and set the locale with ConfigProvider. React 19 projects must also import @arco-design/web-react/es/_util/react-19-adapter first, or imperative APIs such as Message and Modal cannot render.

Examples

  • Basic: When the mouse is moved in, the bubble appears, and when the mouse is moved out, the bubble disappears.
  • Mini Size: Suitable for small scenes or digital bubble styles.
  • Position: Tooltip supports 12 different positions. They are: upper left upper upper right lower left down lower right upper left left lower left upper right right lower right.
  • Control: Use popupVisible and onVisibleChange to control the expansion and collapse of the drop-down box. The specific trigger timing of onVisibleChange can be found in the Trigger component document
  • Color: Set tooltip with different background colors through the color property

Examples come from the official Arco Design repository (MIT) at the commit published as npm 2.66.18. Some use online images or upload endpoints; network requests are disabled in previews.

API

Tooltip

PropertyDescriptionTypeDefaultValueVersion
blurToHideWhether close the popup when the target element losing focusbooleantrue-
defaultPopupVisibleWhether the popup is visible by defaultboolean--
disabledWhether disable popupboolean--
miniWhether show mini styleboolean--
popupHoverStayWhether the popup is visible when the mouse hovers over the popupbooleantrue-
popupVisibleWhether the popup is visibleboolean--
unmountOnExitWhether to destroy the popup when hiddenbooleantrue-
childrenPrefixSet an additional class name(${childrenPrefix}-open) for the container of the popup.string--
colorbackground color of the popup-layerstring-2.22.0
positionThe position of the popup relative to the target.| 'top'| 'tl'| 'tr'| 'bottom'| 'bl'| 'br'| 'left'| 'lt'| 'lb'| 'right'| 'rt'| 'rb'top-
triggerTrigger modeTriggerProps['trigger']hover-
contentThe content shown in popupReactNode--
classNameAdditional css classstring | string[]--
styleAdditional styleCSSProperties--
triggerPropsThe Props of the Trigger componentPartial<TriggerProps>--
getPopupContainerThe parent node which the popup will be rendered to.(node: HTMLElement) => Element--
onVisibleChangeCallback when the visibility of the popup is changed(visible: boolean) => void--