Installation
Add Component
Copy the code snippet below into you components folder.
Integrate Recipe
Integrate this recipe in to your Panda config.
Usage
Examples
Arrow
Use the showArrow prop to show an arrow on the tooltip.
Placement
Use the positioning.placement prop to change the position of the tooltip.
Offset
Use the positioning.offset prop to change the offset of the tooltip.
Delay
Use the openDelay and closeDelay prop to change the delay of the tooltip.
Custom Background
Use the --tooltip-bg CSS variable to change the background color of the tooltip.
Controlled
Use the open and onOpenChange prop to control the visibility of the tooltip.
Interactive
Use the interactive prop to keep the tooltip open when interacting with its content.
Disabled
Use the disabled prop to disable the tooltip. When disabled, the tooltip will not be shown.
With Avatar
Here's an example of how to use the Tooltip component with an Avatar component.
With Switch
Here's an example of how to wrap Tooltip around a Switch component.
Props
Root
| Prop | Default | Type | 
|---|---|---|
| closeDelay | 500 | numberThe close delay of the tooltip. | 
| closeOnClick | true | booleanWhether the tooltip should close on click | 
| closeOnEscape | true | booleanWhether to close the tooltip when the Escape key is pressed. | 
| closeOnPointerDown | true | booleanWhether to close the tooltip on pointerdown. | 
| closeOnScroll | true | booleanWhether the tooltip should close on scroll | 
| interactive | false | booleanWhether the tooltip's content is interactive. In this mode, the tooltip will remain open when user hovers over the content. | 
| lazyMount | false | booleanWhether to enable lazy mounting | 
| openDelay | 1000 | numberThe open delay of the tooltip. | 
| skipAnimationOnMount | false | booleanWhether to allow the initial presence animation. | 
| unmountOnExit | false | booleanWhether to unmount on exit. | 
| aria-label | stringCustom label for the tooltip. | |
| defaultOpen | booleanThe initial open state of the tooltip when rendered. Use when you don't need to control the open state of the tooltip. | |
| disabled | booleanWhether the tooltip is disabled | |
| id | stringThe unique identifier of the machine. | |
| ids | Partial<{ trigger: string; content: string; arrow: string; positioner: string }>The ids of the elements in the tooltip. Useful for composition. | |
| immediate | booleanWhether to synchronize the present change immediately or defer it to the next frame | |
| onExitComplete | VoidFunctionFunction called when the animation ends in the closed state | |
| onOpenChange | (details: OpenChangeDetails) => voidFunction called when the tooltip is opened. | |
| open | booleanThe controlled open state of the tooltip | |
| positioning | PositioningOptionsThe user provided options used to position the popover content | |
| present | booleanWhether the node is present (controlled by the user) |