NOCTA UI

Tooltip

A floating tooltip component that displays additional information on hover or focus with smart positioning and accessibility features

Installation

Install the Tooltip component using the nocta-ui CLI:

npx nocta-ui add tooltip

Import the components you need:

import {
  Tooltip,
  TooltipTrigger,
  TooltipContent,
} from '@/components/ui/tooltip';

Examples

Simple Tooltip

With Text Trigger

This text has a
tooltip
that explains more.

Delay Duration

Control how long the user must hover before the tooltip appears using the delayDuration prop.

API Reference

Tooltip

The provider that manages tooltip behavior and timing.

PropTypeDefaultDescription
delayDurationnumber400Delay before showing tooltip (ms)
childrenReact.ReactNode-Tooltip subtree

TooltipTrigger

Element that triggers the tooltip on hover/focus.

PropTypeDefaultDescription
childrenReact.ReactNode-Trigger content (element or text)
classNamestringundefinedAdditional classes for the trigger wrapper

TooltipContent

The tooltip content that appears on hover/focus. Renders in a portal.

PropTypeDefaultDescription
variant'default''default'Visual style variant
childrenReact.ReactNode-Tooltip content
classNamestringundefinedAdditional classes for the content container