Tooltip

Tooltip

import Tooltip from "@kiwicom/orbit-components/lib/Tooltip";
<Tooltip content="Your content">
<Airplane />
</Tooltip>

Props

NameTypeDefaultDescription
childrenReact.NodeThe reference element where the Tooltip will appear.
contentReact.NodeThe content to display in the Tooltip.
dataTeststringOptional prop for testing purposes.
idstringSet id for Tooltip
enabledbooleantrueEnable render of tooltip
blockbooleanfalseWhether the children wrapper is inline or block. Useful when children need to take up the entire container width.
removeUnderlinedTextbooleanRemoves underline on child component, when underline is not desired.
sizesizeThe maximum possible size of the Tooltip.
stopPropagationbooleanIf true the click event on children won’t bubble. Useful when you use Tooltip inside another clickable element.
lockScrollingbooleantrueWhether to prevent scrolling of the rest of the page while Tooltip is open on mobile. This is on by default to provide a better user experience.
renderInPortalbooleantrueOptional prop, set it to false if you’re rendering Tooltip inside a custom portal, defaults to true
placementplacementauto12 different placements to choose from
noFlipbooleanfalseTurns off automatic flipping of the Tooltip when there is not enough space
offset[number, number][0, 5]Set offset [vertical, horizontal] for Tooltip
tabIndexstring \| number"0"Specifies the tab order of an element
onShow() => void \| () => Promise<void>Callback when Tooltip is shown
labelClosestringCloseLabel for close button.

enum

size
"small"
"medium"

placement

Placement
"top"
"right"
"bottom"
"left"
"top-start"
"top-end"
"right-start"
"right-end"
"bottom-start"
"bottom-end"
"left-start"
"left-end"
"auto"
"auto-start"
"auto-end"
"bottom"

Functional specs

<Tooltip
content={
<Stack>
<CustomImage />
<Text>You can find the CVV in the right corner of your credit card.</Text>
<List>
<ListItem>Additional information</ListItem>
</List>
</Stack>
}
>
<InformationCircle />
</Tooltip>