A <Tooltip /> component for React Native
JavaScript Objective-C Python Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
TooltipExample
.babelrc
.eslintrc
.gitignore
.npmignore
LICENSE
README.md
Tooltip.js
Triangle.js
getTooltipCoordinate.js
helpers.js
package.json
tooltipExample.gif
yarn.lock

README.md

rn-tooltip

Simple, lightwweight and blazing fast react native tooltip

Install

yarn add rn-tooltip

or

npm install rn-tooltip --save

Usage

import Tooltip from 'rn-tooltip';

...

<Tooltip tooltipWidth={200} tooltipText="Tooltip info goes here">
  <Text>Press me</Text>
</Tooltip>

Check the code inside the example app

Props

type Props = {
  children: React.Element,
  withPointer: boolean, // default true
  tooltipText?: string,

  tooltipComponent?: React.Element, // tooltipComponent substitutes the Text inside View for what ever
  //you pass here. 

  toggleOnPress: boolean, // open tooltip if you press element. Defaut is false
  tooltipHeight: number, // necessary to calculate positioning.
  tooltipWidth: number, // necessary to calculate positioning.
  tooltipContainerStyle?: any,
  pointerColor?: string,
  tooltipTextStyle?: any,
  onClose?: () => any,
  withOverlay?: boolean, // default true.
  backgroundColor?: string,
  hightlightColor?: string,
  tooltipContainerDefaultStyle?: any,
};

MIT Licensed