npx gluestack-ui add tooltipimport { Tooltip } from '@/components/ui/tooltip';


export default () => (
<Tooltip>
<TooltipContent>
<TooltipText />
</TooltipContent>
</Tooltip>
);
| Prop | Type | Default | Description |
|---|---|---|---|
isOpen | boolean | false | Whether the tooltip is opened. Useful for controlling the open state. |
isDisabled | boolean | false | Whether the tooltip is disabled. |
defaultIsOpen | boolean | false | If true, the popover will be opened by default. |
onOpen | () => void | true | This function will be invoked when the tooltip is opened. |
onClose | () => void | - | This function will be invoked when tooltip is closed. It will also be called when the user attempts to close the tooltip via Escape key or backdrop press. |
openDelay | number | 0 | Duration in ms to wait till displaying the tooltip. |
closeDelay | number | 0 | Duration in ms to wait till hiding the tooltip. |
placement | "bottom" | "top" | "right" | "left" | "top left" | "top right" | "bottom left" | "bottom right" | "right top" | "right bottom" | "left top" | "left bottom" | bottom left | Tooltip placement |
children | any | - | The content to display inside the tooltip. |
closeOnClick | boolean | true | Whether tooltip should be closed on Trigger click. |
trigger | () => any | - | Function that returns a React Element. This element will be used as a Trigger for the tooltip. |
offset | number | 10 | Distance between the trigger and the tooltip. |
crossOffset | number | - | The additional offset applied along the cross axis between the element and its trigger element. |
shouldOverlapWithTrigger | boolean | false | Determines whether tooltip content should overlap with the trigger. |
shouldFlip | boolean | true | Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely. |
closeOnOverlayClick | boolean | true | Closes tooltip when clicked outside. |