{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tooltip",
  "type": "registry:ui",
  "title": "Tooltip",
  "description": "A few words that appear beside a control on hover or keyboard focus.",
  "categories": [
    "ui"
  ],
  "dependencies": [
    "radix-ui"
  ],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/cn"
  ],
  "files": [
    {
      "path": "registry/ui/tooltip.tsx",
      "type": "registry:ui",
      "target": "components/ui/tooltip.tsx",
      "content": "\"use client\";\n/**\n * @name tooltip\n * @category ui\n * @description A few words that appear beside a control on hover or keyboard focus.\n * @when Naming an icon-only button or adding a short hint. It does not open on touch, so never put anything needed there: the control keeps its own `aria-label`. For content people interact with use popover. Put one TooltipProvider around the app (root layout); every Tooltip must be inside one.\n * @example\n * <TooltipProvider>\n *   <Tooltip>\n *     <TooltipTrigger asChild>\n *       <Button variant=\"ghost\" size=\"icon\" aria-label=\"Copy link\"><Link2 /></Button>\n *     </TooltipTrigger>\n *     <TooltipContent>Copy link</TooltipContent>\n *   </Tooltip>\n * </TooltipProvider>\n */\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\n/** Shares the open delay between tooltips, so moving from one to the next shows it at once. */\nexport function TooltipProvider({ delayDuration = 300, ...props }: ComponentProps<typeof TooltipPrimitive.Provider>) {\n  return <TooltipPrimitive.Provider delayDuration={delayDuration} {...props} />;\n}\n\nexport function Tooltip(props: ComponentProps<typeof TooltipPrimitive.Root>) {\n  return <TooltipPrimitive.Root {...props} />;\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof TooltipPrimitive.Trigger>) {\n  return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\n/* Radix's open states here are \"delayed-open\" and \"instant-open\", so the enter animation runs on mount, not on data-[state=open]. */\nexport function TooltipContent({ className, sideOffset = 6, collisionPadding = 8, ...props }: ComponentProps<typeof TooltipPrimitive.Content>) {\n  return (\n    <TooltipPrimitive.Portal>\n      <TooltipPrimitive.Content\n        data-slot=\"tooltip-content\"\n        sideOffset={sideOffset}\n        collisionPadding={collisionPadding}\n        className={cn(\n          \"z-50 w-fit max-w-[min(20rem,var(--radix-tooltip-content-available-width))] origin-(--radix-tooltip-content-transform-origin) animate-in rounded-surface border bg-popover px-3 py-1.5 text-xs text-balance text-popover-foreground ease-out animation-duration-(--duration-base) fade-in-0 fade-out-0 zoom-in-95 zoom-out-95 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 data-[state=closed]:animate-out motion-reduce:animate-none!\",\n          className,\n        )}\n        {...props}\n      />\n    </TooltipPrimitive.Portal>\n  );\n}\n"
    }
  ],
  "meta": {
    "category": "ui",
    "when": "Naming an icon-only button or adding a short hint. It does not open on touch, so never put anything needed there: the control keeps its own `aria-label`. For content people interact with use popover. Put one TooltipProvider around the app (root layout); every Tooltip must be inside one.",
    "example": "<TooltipProvider>\n  <Tooltip>\n    <TooltipTrigger asChild>\n      <Button variant=\"ghost\" size=\"icon\" aria-label=\"Copy link\"><Link2 /></Button>\n    </TooltipTrigger>\n    <TooltipContent>Copy link</TooltipContent>\n  </Tooltip>\n</TooltipProvider>",
    "client": true
  }
}
