Short hint shown on hover or focus.

Base UI APISource

Installation

pnpm dlx shadcn@latest add https://yea-ui.vercel.app/r/tooltip.json

Usage

import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"
<TooltipProvider>
  <Tooltip>
    <TooltipTrigger render={<Button variant="ghost" />}>Hover me</TooltipTrigger>
    <TooltipContent>Saved</TooltipContent>
  </Tooltip>
</TooltipProvider>

Examples

Sides

Position the popup with the side prop.

API reference

TooltipProvider

Shares the open delay between tooltips. Wrap once near the app root.

PropTypeDefaultDescription
delaynumber300Milliseconds before the tooltip opens.

TooltipTrigger

Use the render prop to attach the tooltip to an existing button.

TooltipContent

PropTypeDefaultDescription
side"top" | "bottom" | "left" | "right""bottom"Which side of the trigger the popup appears on.
sideOffsetnumber6Gap between trigger and popup in pixels.

All other props are forwarded to the underlying Base UI component.