Components

Tooltip

Contextual popup with configurable placement, arrow, and visual variants.

iOSAndroid
Preview Tooltip on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-tooltip
Required Packages(1 package)
pnpm add react-native-reanimated

Usage

import { Tooltip } from '@/components/docyrus-native/tooltip';

<Tooltip text="This is a tooltip" placement="top">
  <Button title="Hover me" />
</Tooltip>

<Tooltip text="Auto-dismiss" delayHide={3000} variant="dark">
  <Text>Tap me</Text>
</Tooltip>

API Reference

PropTypeDefaultDescription
visibleboolean—Controlled visibility state
defaultOpenbooleanfalseWhether the tooltip is initially open
onOpenChange(open: boolean) => void—Callback when visibility changes
onClose() => void—Callback when tooltip closes
textstring—Tooltip text content (required)
placement'top' | 'bottom' | 'left' | 'right' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight''bottom'Tooltip position relative to the trigger
offsetnumber8Distance from the trigger element in pixels
arrowbooleantrueShow directional arrow
size'sm' | 'md' | 'lg''md'Tooltip padding and font size
variant'default' | 'dark' | 'light''default'Visual style variant
delayHidenumber0Auto-hide delay in milliseconds (0 = manual close only)
maxWidthnumber—Maximum tooltip width
childrenReactNode—Trigger element
classNamestring—Tooltip bubble CSS classes
contentClassNamestring—Inner content container CSS classes
textClassNamestring—Tooltip text CSS classes

Type Exports

TypeDescription
TooltipPropsProps for Tooltip component
TooltipPlacement'top' | 'bottom' | 'left' | 'right' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'
TooltipSize'sm' | 'md' | 'lg'
TooltipVariant'default' | 'dark' | 'light'

On this page