Tooltip

Tooltips display brief labels or messages

Usage

Tooltip displays informative text when users hover, focus, or click a target.

import { Tooltip, Button } from "@udixio/ui-react"

Content

Use content to render fully custom tooltip content (Markdown, rich text, or components). When content is provided, title, text, and buttons are ignored.

Variants

Plain is a small text bubble. Rich is card-like with title, text, and actions.

Triggers

Control how the tooltip appears using trigger: “hover”, “focus”, “click” or an array of these.

Guidelines (M3 aligned)

Use plain tooltips to label icon-only controls; rich tooltips are for longer explanations and optional actions.

Avoid hiding critical info inside a tooltip; use a dialog for destructive or required decisions.

Delays

Use openDelay and closeDelay (ms) to tune the hover/focus behavior. Defaults: openDelay={400}, closeDelay={150}.

Controlled open state

Use isOpen with onOpenChange to fully control the visibility. Use defaultOpen for uncontrolled initial state.

Position

Provide an explicit position or let it auto-place based on target position.

Behavior

On desktop, tooltips open on hover or focus. Use trigger="click" for persistent rich tooltips that stay open until another interaction.

Keyboard

KeysActions
TabFocus lands on button, if available
Space or EnterActivates the focused element

Accessibility

  • The tooltip uses role="tooltip" and links to its trigger via aria-describedby when open.
  • Press Escape to close an open tooltip.