Skip to content

Infotip

An information icon that opens a short explanation on hover, click or touch.

Chunk overlap
hero.tsx

Usage guidelines

  • Use Infotip when an information icon's primary action is opening an explanation. Use Tooltip when the trigger already has another primary action and only needs a visual hint.
  • Infotip is a popover: it opens on hover, click, touch and keyboard activation, so its content reaches every user and can hold links.
  • Name the trigger with aria-labelledby when a visible topic exists, otherwise with a short aria-label. The trigger needs its name while the popup is closed, so it never comes from the popup content.
  • Name the popup with the same short topic, through aria-labelledby, aria-label or an InfotipTitle. Do not copy the explanation into either name, and keep the body as normal children rather than turning it into the dialog's description.
  • InfotipTrigger stops click propagation, so an infotip inside a clickable row or card does not trigger the enclosing action.
  • Infotip owns its surface, spacing, typography, radius and shadow. Callers may constrain the width or keep intentional line breaks, and may place and color the trigger, but do not resize it; use size.

Anatomy

tsx
tsx

InfotipTrigger renders the icon button itself and takes no children; iconVariant picks its glyph: question (the default), information or warning. InfotipContent bundles the portal, positioner and popup, and opens on the top side by default.

Examples

Named by a title

When adjacent text states a value rather than the topic, InfotipTitle gives the dialog its name while the trigger carries a matching aria-label.

High priority
title.tsx

The popup can hold interactive content. Opening it from the keyboard moves focus to the first link.

System prompt
link.tsx

Icon variants

iconVariant selects the trigger glyph: question for general help, information for factual details and warning for caveats.

  • Top K
    question
  • Model context
    information
  • Legacy indexing
    warning
icon-variants.tsx

Sizes

size sets the icon and the trigger's layout box together: sm (12px), md (16px, the default) and lg (16px with a larger icon). Every size keeps a 24px pointer target outside its layout box, so the larger target does not move the surrounding content. An ancestor that clips overflow also clips that target.

  • Top K
    sm
  • Score threshold
    md
  • Rerank model
    lg
sizes.tsx

Keyboard

KeyAction
EnterorSpaceOpens the infotip from a focused trigger and moves focus into the popup, to its first link when it has one.
TabMoves focus past the popup's last link to the next control on the page and closes the popup.
EscapeCloses the infotip and returns focus to the trigger.

API reference

Infotip

Groups an icon button trigger and an accessible explanation popover. Doesn't render its own HTML element.

Opens on hover, click, touch, or keyboard activation and supports interactive content such as links.

Base UI Popover.Root docs

InfotipContent

A container for the popover contents. Renders a <div> element.

Base UI Popover.Popup docs

Props
PropTypeDefaultDetails
side'bottom' | 'inline-end' | 'inline-start' | 'left' | 'right' | 'top''top'
sideOffsetnumber | OffsetFunction8
children requiredReact.ReactNodeNo default
Base UI Popover.Popup docs
Data attributes
AttributeDescription
data-open

Present when the popup is open.

data-closed

Present when the popup is closed.

data-starting-style

Present when the popup begins animating in.

data-ending-style

Present when the popup is animating out.

data-side

Values: 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'

Indicates which side the popup is positioned relative to the trigger.

data-align

Values: 'start' | 'center' | 'end'

Indicates how the popup is aligned relative to specified side.

data-instant

Values: 'click' | 'dismiss' | 'focus' | 'trigger-change'

Present if animations should be instant.

CSS variables
VariableDescription
--popup-width

The width of the popup.

--popup-height

The height of the popup.

--available-width

Values: number

The available width between the trigger and the edge of the viewport.

--available-height

Values: number

The available height between the trigger and the edge of the viewport.

--anchor-width

Values: number

The anchor's width.

--anchor-height

Values: number

The anchor's height.

--transform-origin

Values: string

The coordinates that this element is anchored to. Used for animations and transitions.

--positioner-width

Values: number

The width of the popover's positioner. It is important to set width to this value when using CSS to animate size changes.

--positioner-height

Values: number

The height of the popover's positioner. It is important to set height to this value when using CSS to animate size changes.

InfotipTitle

A heading that labels the popover. Renders an <h2> element.

Base UI Popover.Title docs

InfotipTrigger

An icon button that opens the infotip on hover or click and stops click propagation; requires aria-label or aria-labelledby. Renders a <button> element.

Base UI Popover.Trigger docs

Props
PropTypeDefaultDetails
aria-labelstringNo default
aria-labelledbystringNo default
iconVariant'information' | 'question' | 'warning''question'
size'lg' | 'md' | 'sm''md'
openOnHoverbooleantrue
closeDelaynumber200
Base UI Popover.Trigger docs

Valid prop combinations:

  • aria-label: string, aria-labelledby?: undefined
  • aria-label?: undefined, aria-labelledby: string
Data attributes
AttributeDescription
data-popup-open

Present when the corresponding popover is open.

data-pressed

Present when the trigger is pressed.

data-disabled

Present when the trigger is disabled.