Small hint surface for labels, shortcuts, and extra context.
npx shadcn@latest add @iconiq/r-tooltipimport { Tooltip } from "@/components/ui/r-tooltip";
const triggerClass =
"rounded-lg px-0.5 font-semibold underline decoration-dotted underline-offset-[5px] transition-colors";
export function TooltipPreview() {
return (
<div className="flex min-h-[260px] flex-col items-center justify-center gap-8 px-4 py-8">
<blockquote className="max-w-lg text-center">
<p className="text-lg font-medium leading-relaxed tracking-tight dark:text-neutral-100">
Win the{" "}
<Tooltip content="Press, recycle, stay compact." delay={0.12} side="top">
<button
className={`${triggerClass} text-emerald-700 decoration-emerald-500/40 dark:text-emerald-400`}
type="button"
>
midfield
</button>
</Tooltip>
, then{" "}
<Tooltip content="One ball behind the line." side="bottom">
<button
className={`${triggerClass} text-sky-700 decoration-sky-500/40 dark:text-sky-400`}
type="button"
>
break the last line
</button>
</Tooltip>
— that's the half in two beats.
</p>
</blockquote>
<p className="max-w-sm text-center text-[13px] leading-relaxed text-neutral-500 dark:text-neutral-400">
Hover the calls or{" "}
<Tooltip content="Tab in — same note." side="right">
<button
className={`${triggerClass} text-neutral-700 decoration-neutral-400/70 dark:text-neutral-300`}
type="button"
>
use the keyboard
</button>
</Tooltip>
.
</p>
</div>
);
}childrenA single trigger element that receives hover, focus, and aria-describedby props through a slotted wrapper.
Type ReactElement
contentShort, non-interactive tooltip copy rendered inside the animated bubble. Use Popover for longer or richer content.
Type string
sidePreferred popup side passed into the collision-aware Radix popover positioner.
Type "top" | "bottom" | "left" | "right"·Default top
delayOpen delay in seconds. The implementation multiplies it by 1000 before scheduling the timer.
Type number·Default 0.15
classNameMerged onto the tooltip bubble for local surface styling overrides.
Type string
The tooltip is portaled through the selected headless library while preserving the same bubble shell, rotated-square arrow, and collision settings.
Uses Radix Tooltip portal and content primitives for placement while keeping the exact Iconiq tooltip surface and arrow shell.
The trigger receives an aria-describedby link to the active tooltip bubble.
The popup keeps avoidCollisions with collisionPadding=12 and sideOffset=10.
The arrow is still a rotated square whose placement follows the resolved side data attribute.
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: @radix-ui/react-tooltip, @radix-ui/react-slot, motion.
Installs a Radix tooltip with the same public content, side, and delay API as the Base UI version.
Preserves the same tooltip bubble classes, rotated-square arrow, controlled delay semantics, and spring timing as the core Iconiq tooltip component.
The generated registry file is /r/r-tooltip.json.
Contact
Additionally, if you find any bug or issue, feel free to raise an issue.