Skip to content
SENVENLI UI

Tooltip

A short hint for a control on hover and keyboard focus, and on tap for touch users when needed.
Naming an icon button
import { Tooltip } from "@senvenli/react/overlay";

Examples

With a shortcut

The key that does the same thing, as a chip.

Placement

Above by default; it flips when there is no room.

Readable on touch

With openOnTouch a tap opens it, for a status that has no action of its own.

Guidelines

When to use it

  • Naming an icon button or adding a short hint.

Use something else when

  • The content is interactive or long. Popover
  • The hint is rich content, such as a profile, and opens from a link. Hover card

Accessibility

Built in

  • Opens on keyboard focus too; touch users can tap with openOnTouch.

You provide

  • Content that is a hint, never the only place important information lives.

API reference

Tooltip

contentRequired
string

Plain text only: the same words as the control's aria-label, or a truncated value in full.

childrenRequired
ReactElement<unknown, string | JSXElementConstructor<any>>

The trigger. It must be focusable; a non-interactive element (a truncated lozenge) is made focusable.

placement
Placement
shortcut
string

A keyboard shortcut shown as a chip ("F").

openOnTouch
boolean

Readable on touch screens: a tap on the trigger opens the tooltip and a second tap closes it; a tap anywhere else, or Esc, closes it. Mouse hover and keyboard focus work exactly as without it. For a trigger that does nothing on its own (a country flag, a truncated value); on a button the tap still presses it.

motion
ComponentMotion

auto (follow the device), reduce or none, for this component; the provider's setting otherwise.