React

Help Bubble Tooltip

A tooltip-style Help Bubble that displays supplementary information when the pointer hovers over or focuses on an element.

Available since@seed-design/react@2.0.0, @seed-design/css@2.0.0

Installation

npx @seed-design/cli@latest add ui:help-bubble-tooltip

Props

HelpBubbleTooltipTrigger

Prop

Type

titleReact.ReactNode
description?React.ReactNode
children?React.ReactNode
contentProps?SeedHelpBubbleTooltip.ContentProps | undefined
zIndexOffset?number | undefined

HelpBubbleTooltipDelayGroup

Prop

Type

children?React.ReactNode

Examples

Hover & Focus

Moving the pointer over (hover) or using the keyboard to focus on the children of HelpBubbleTooltipTrigger opens the Help Bubble Tooltip.

The children should contain a focusable element like a button.

Help Bubble Tooltip does not include a Close Button or internal interaction elements. If you need to open and close by clicking (Toggletip), or if you need a Close Button, use Help Bubble.

Delay

openDelay controls the time until opening after the pointer moves in, and closeDelay controls the time until closing after the pointer moves away. The defaults are 200ms and 100ms respectively, and neither delay is applied when opening by focus.

Delay Group

Once one Help Bubble Trigger in the same HelpBubbleTooltipDelayGroup is open, moving the pointer to another trigger in the same group opens it immediately without openDelay. You can specify openDelay or closeDelay in HelpBubbleTooltipDelayGroup to control the delays of triggers within the group uniformly.

If you directly set openDelay or closeDelay on a HelpBubbleTooltipTrigger within the group, that value takes precedence over the group delay.

Keep Open on Content Hover

By default, moving the pointer over the Help Bubble Tooltip is considered leaving the trigger and it closes. With keepOpenOnContentHover, moving the pointer over the Help Bubble Tooltip does not close it, and you can interact with the content, such as dragging to select text inside the Help Bubble Tooltip.

Placement

Flip

Description

You can add a description below title using description.

Title Only

Setting Width Manually

content has a default maximum width. Specifying maxWidth in contentProps overrides this default, and specifying none removes the maximum width limit.

Line Breaks

z-index Offset

Accessibility

Icon-only Button

The content of Help Bubble Tooltip functions as a description of the trigger, not as a replacement for the trigger's name. Regardless of whether Help Bubble Tooltip is used, always provide aria-label for buttons with only icons and no text.

<HelpBubbleTooltipTrigger title="Password must be at least 8 characters long, including letters, numbers, and special characters.">
  {/* Provide aria-label to the icon-only ActionButton. */}
  <ActionButton layout="iconOnly" aria-label="Password requirements">
    <Icon svg={<IconILowercaseSerifCircleFill />} />
  </ActionButton>
</HelpBubbleTooltipTrigger>

Disabled Triggers

By default, <button disabled> elements cannot be focused by the keyboard, so if you use such an element as a trigger, the Help Bubble Tooltip cannot be opened via the keyboard.

If you need to explain why a button is disabled, it is recommended to display the reason alongside the disabled button as nearby text, rather than attaching a Help Bubble Tooltip to the disabled button. If you must attach a Help Bubble Tooltip to a disabled button, wrap the button in a focusable span (tabIndex={0}) and use it as children.

Table of contents