Search documentation

Search the documentation and open a page.

Displays contextual information when an element is hovered or focused.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/tooltip

Composition

TooltipProvider (optional) └── Tooltip ├── TooltipTrigger └── TooltipContent └── TooltipArrow (optional)

Examples

Default

Loading...

Long Label

Loading...

Side

Loading...

With Shortcut

Loading...

API Reference

Tooltip

PropTypeDefaultDescription
idstring | undefined—Unique identifier used to connect the component parts.
idsElementIds | undefined—Overrides generated identifiers for individual parts.
openDelaynumber | undefined—Configures open delay.
closeDelaynumber | undefined—Configures close delay.
closeOnPointerDownboolean | undefined—Configures close on pointer down.
closeOnEscapeboolean | undefinedtrueConfigures close on escape.
closeOnScrollboolean | undefined—Configures close on scroll.
closeOnClickboolean | undefined—Configures close on click.
interactiveboolean | undefined—Configures interactive.
onOpenChange((details: OpenChangeDetails) => void) | undefined—Runs when open changes.
positioningPositioningOptions | undefined—Configures floating-element placement and collision handling.
disabledboolean | undefinedfalseDisables interaction with the component.
openboolean | undefined—Whether the component is open when controlled.
defaultOpenboolean | undefined—Initial open state when uncontrolled.
triggerValuestring | null | undefined—Configures trigger value.
defaultTriggerValuestring | null | undefined—Configures default trigger value.
onTriggerValueChange((details: TriggerValueChangeDetails) => void) | undefined—Runs when trigger value changes.

Context, Hooks, and Types

ExportAPI
TooltipContextRender-prop component that exposes component state and actions.
TooltipProviderProvides an externally created API to the component tree.
TooltipRootProviderProvides an externally created API to the component tree.
useTooltipCreates or accesses the component API.
useTooltipContextReturns the nearest component API.
TooltipOpenChangeDetailsType for the details object passed to the matching change callback.