Skip to content

Tooltip

A simple text prompt bubble triggered on hover or keyboard focus.

Basic usage

Trigger on hover

Hover to view

Placement

Four directions

UpDownLeftRight

When space is insufficient, the tooltip automatically flips along the main axis and avoids the viewport edges.

Focus trigger

Trigger on keyboard focus

Focus me with Tab

Controlled display

The open attribute is controlled: an external button can set/remove open to show/hide the tooltip (hover/focus triggers still apply in addition).

Controlled display (open attribute)

ShowHideopen: falseTrigger element

Long text

Long text and max width

Hover to view long hint

Edge cases

Empty content

Tooltip without content

API

Attributes

AttributeDescriptionTypeDefault
contentTooltip content textstring
openControlled display (boolean attribute; shows when present)boolean
placementPopup placementPlacementtop

Slots

NameDescription
default

No public events. Shown/hidden on hover or focus; role="tooltip", the popup uses pointer-events: none so it never blocks interactions.