Tooltip
Tooltip Updates​
Changes:​
- Updated Tooltip structure to use
Tooltip
,TooltipTrigger
, andTooltipContent
. - Removed deprecated
TooltipClipboard
and inlinecontent
/position
properties.
Migration Steps:​
-
Replace imports:
// Before
import { Tooltip } from '@ohif/ui';
import { TooltipClipboard } from '@ohif/ui';
// After
import { Tooltip, TooltipTrigger, TooltipContent } from '@ohif/ui-next'; -
Update Tooltip usage:
// Before
<Tooltip content={<div>Tooltip Message</div>} position="bottom-left">
<Component />
</Tooltip>
// After
<Tooltip>
<TooltipTrigger asChild>
<Component />
</TooltipTrigger>
<TooltipContent side="bottom">
Tooltip Message
</TooltipContent>
</Tooltip> -
TooltipClipboard Replacement: The
TooltipClipboard
component has been removed. Instead, use theClipboard
component insideTooltipContent
for copying text functionality.
Before:​
<TooltipClipboard>{text}</TooltipClipboard>
After:​
<Tooltip>
<TooltipTrigger asChild>
<span className="cursor-pointer truncate">{text}</span>
</TooltipTrigger>
<TooltipContent side="bottom">
<div className="flex items-center justify-between gap-2">
{text}
<Clipboard>{text}</Clipboard>
</div>
</TooltipContent>
</Tooltip>