Skip to main content

Overview

HuxTooltip component provides additional context when hovering over or long-pressing on widgets. It automatically adapts to light and dark themes and provides various positioning and styling options.

Basic Usage

The simplest way to use a tooltip is to wrap any widget with HuxTooltip:

Variants

Standard Tooltip

The basic tooltip with customizable styling: Standard tooltip

Tooltip with Icon

For enhanced visual context, add an icon parameter to HuxTooltip. Tooltip with icon

Customization

Colors

Customize the tooltip appearance with your own colors:

Positioning

Control where the tooltip appears relative to the child:

Timing

Adjust when and how long the tooltip appears:

Advanced Styling

For complete control over the tooltip appearance:

Props

HuxTooltip

HuxTooltip Icon Parameters

Examples

Provide context for form inputs:

Button Explanations

Explain button actions:
Guide users through complex interfaces:

Best Practices

Content Guidelines

  • Keep messages concise: Tooltips should be brief and to the point
  • Use clear language: Avoid technical jargon unless necessary
  • Provide value: Only show tooltips when they add meaningful context

Accessibility

  • Semantic content: Tooltips are automatically included in the accessibility tree
  • Keyboard navigation: Tooltips work with keyboard navigation
  • Screen readers: Content is properly announced to assistive technologies

Performance

  • Lazy loading: Tooltips only render when needed
  • Efficient positioning: Smart positioning algorithms minimize layout calculations
  • Memory management: Proper cleanup when tooltips are dismissed

Theme Integration

  • Automatic adaptation: Tooltips automatically adapt to light/dark themes
  • Consistent styling: Uses Hux design tokens for consistent appearance
  • Customizable: Override theme colors when needed for specific use cases
  • Button - Add tooltips to buttons for better UX
  • Input - Provide help text for form fields
  • Card - Add context to card content
  • Badge - Explain badge meanings with tooltips