Skip to content

Tooltip

Tooltip provides an anchored contextual balloon anchored to any trigger element, rendering a directional pointer arrow and handling touch-outside dismissal.

Usage

TooltipExample.tsx
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

TapTooltip.tsx
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

PropTypeDefaultDescription
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.
autoFlipbooleantrueAutomatically 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.
arrowbooleantrueWhether to render the directional pointer arrow.
delaynumber0Delay in milliseconds before showing tooltip after trigger.
delayLongPressnumber250Hold duration in milliseconds required to trigger longPress mode.
dismissOnPressOutbooleanfalseWhether releasing the hold dismisses the tooltip immediately.
durationnumber—Auto-dismiss timeout duration in milliseconds.
visibleboolean—Controlled visibility state.
onOpenChange(open: boolean) => void—Callback fired when open state changes.
hapticbooleantrueEnable tactile feedback on tooltip trigger.
glassbooleanfalseEnable translucent glassmorphism balloon styling.
children*ReactElement—Target trigger element.