Tooltip

An interactive, animated popup that displays information related to an element when it receives keyboard focus or when the mouse hovers over it.

Installation

npx shadcn@latest add https://scrollxui.dev/registry/tooltip.json 

Usage

import {
  Tooltip,
  TooltipContent,
  TooltipTrigger,
} from "@/components/ui/tooltip"
<Tooltip>
  <TooltipTrigger>Hover</TooltipTrigger>
  <TooltipContent>
    <p>Isn't it cool?</p>
  </TooltipContent>
</Tooltip>

API Reference

Tooltip

An interactive, animated popup that displays information related to an element when it receives keyboard focus or when the mouse hovers over it.

Props

PropertyTypeDefaultDescription
delayDurationnumber0
Time in milliseconds to wait before showing the tooltip. Used in TooltipProvider.
childrenReactNoderequired
Content of the tooltip or the trigger element.
sideOffsetnumber0
Distance in pixels between the trigger and the tooltip. Used in TooltipContent.
asChildbooleanfalse
If true, renders children without wrapping them in a default element. Used in TooltipContent.
classNamestring-
Custom CSS classes applied to TooltipContent.
...propsany-
Other props supported by Radix Tooltip primitives (Root, Trigger, Content, Provider).

Built withby Ahdeetai.