Skip to main content

Installation

Setup

Add the TooltipProvider to the root of your app:
app/layout.tsx

Usage

Examples

Basic

A simple tooltip with text content.

Positioning

Control the position of the tooltip using the side prop.

    With Arrow

    Tooltips include an arrow by default pointing to the trigger element.

    Keyboard Shortcut

    Display keyboard shortcuts in tooltips.

    Disabled Button

    Show a tooltip on a disabled button by wrapping it with a span.

    Delay Duration

    Control how long the user must hover before the tooltip appears.

    Rich Content

    Tooltips can contain rich content, not just text.

    Component Code

    Props

    TooltipProvider

    Tooltip

    TooltipTrigger

    TooltipContent

    Accessibility

    • Automatically associates tooltip with trigger using aria-describedby
    • Keyboard accessible (opens on focus, closes on blur/escape)
    • Uses role="tooltip" for screen readers
    • Portal rendering prevents z-index issues
    • Respects prefers-reduced-motion

    Best Practices

    • Keep tooltip text concise and informative
    • Don’t use tooltips for critical information
    • Ensure tooltips don’t hide important content
    • Use asChild on trigger to merge with custom components
    • Wrap disabled buttons in a span to enable tooltips
    • Consider using instant tooltips (delayDuration={0}) for frequently accessed items

    API Reference

    Built on top of Radix UI Tooltip. See the official API documentation for more details.