Extended from Reka UI Tooltip
A tooltip opens on hover or focus of the trigger button and is useful when additional descriptive text would take up too much room on the page and may not be relevant to all users.
Because the tooltip relies on hover to activate, and there is no hover on touch devices, this component will detect if a device supports touch and, if so, automatically render a Popover instead.
It is NOT recommended to insert a link or button inside a tooltip, as non-mouse users will be unable to access the link or button, and even mouse users may have trouble reaching it as the tooltip may disappear before they can move their cursor to the link or button. If you find yourself needing this use case, consider using Popover instead.
Using the side
prop allows you to control on which side of the triggering element the tooltip will attempt to appear. If there is not enough room on that side, the tooltip will switch to the opposite side.
Positioned on top (default)
Positioned on right
Positioned on bottom
Positioned on left
This example shows the recommended styling for headings within a tooltip.
This tooltip contains a heading
This example shows how to delay the appearance of the tooltip. Only applies on non-touch devices.
This tooltip will appear after 500ms
This example shows how to tell the tooltip that there is a sticky element it should treat as the edge of visibility and flip the tooltip to the opposite side when reached. This is useful when there is a sticky navbar or CTA banner on the page and you want to ensure the tooltip remains visible and doesn't appear partially hidden underneath it.
This tooltip will flip when it gets 100px away from the top of the viewport
This example shows how to control the visibility of the tooltip from an external source. It can still be opened and closed via hover and un-hover, but the buttons also have the ability to show and hide the tooltip.
Use the light variant
if the tooltip will appear against a dark background.
This tooltip only contains text
This tooltip contains a heading
collisionPadding
number or object
0
delayDuration
number
0
show
boolean or undefined
undefined
side
String
'top'
triggerClass
String
''
variant
String
'dark'
trigger
update:show
boolean