Tooltip
Tooltip provides an anchored contextual balloon anchored to any trigger element, rendering a directional pointer arrow and handling touch-outside dismissal.
Usage
import { Tooltip, IconButton } from '@masumdev/rn-ui';import { Download } from 'lucide-react-native';
export function TooltipExample() { return ( <Tooltip content="Download monthly balance statement" position="top"> <IconButton icon={({ color, size }) => <Download color={color} size={size} />} variant="outline" tone="primary" /> </Tooltip> );}Tap Trigger Mode
import { Tooltip, Button } from '@masumdev/rn-ui';import { Info } from 'lucide-react-native';
<Tooltip content="API key configured for production" triggerMode="press" position="top" tone="dark" duration={3000}> <Button tone="secondary" variant="outline"> View Key Status </Button></Tooltip>Props API
| Prop | Type | Default | Description |
|---|---|---|---|
content* | ReactNode | — | Text label or custom element displayed inside the balloon. |
position | "top" | "bottom" | "left" | "right" | "auto" | "top" | Anchored placement relative to target. |
triggerMode | "longPress" | "press" | "longPress" | Interaction gesture used to reveal the tooltip. |
autoFlip | boolean | true | Automatically flip placement when near viewport edges (e.g. right to left, bottom to top). |
tone | "default" | "primary" | "dark" | "light" | "default" | Color tone of the tooltip balloon. |
arrow | boolean | true | Whether to render the directional pointer arrow. |
delay | number | 0 | Delay in milliseconds before showing tooltip after trigger. |
delayLongPress | number | 250 | Hold duration in milliseconds required to trigger longPress mode. |
dismissOnPressOut | boolean | false | Whether releasing the hold dismisses the tooltip immediately. |
duration | number | — | Auto-dismiss timeout duration in milliseconds. |
visible | boolean | — | Controlled visibility state. |
onOpenChange | (open: boolean) => void | — | Callback fired when open state changes. |
haptic | boolean | true | Enable tactile feedback on tooltip trigger. |
glass | boolean | false | Enable translucent glassmorphism balloon styling. |
children* | ReactElement | — | Target trigger element. |