1.0.3 • Published 3 months ago

rn-tooltip-advance v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

npm version

rn-tooltip-advance

Simple, lightwweight and blazing fast react native tooltip

Expo App if you want to try it out: https://expo.io/@andreixoc/RNTooltipTester

Code for the Expo app is here: https://github.com/andreiCalazans/rnTooltipTester

Install

yarn add rn-tooltip-advance

or

npm install rn-tooltip-advance --save

Usage

import { Text } from 'react-native';
import Tooltip from 'rn-tooltip-advance';

...

<Tooltip popover={<Text>Info here</Text>}>
  <Text>Press me</Text>
</Tooltip>

Props


Reference

backgroundColor

sets backgroundColor of the tooltip and pointer.

TypeDefault
string#617080

containerStyle

Passes style object to tooltip container

TypeDefault
object (style)inherited styling

height

Tooltip container height. Necessary in order to render the container in the correct place. Pass height according to the size of the content rendered inside the container.

TypeDefault
numberstring40

highlightColor

Color to highlight the item the tooltip is surrounding.

TypeDefault
stringtransparent

onClose

function which gets called on closing the tooltip.

TypeDefault
function() => {}

onOpen

function which gets called on opening the tooltip.

TypeDefault
function() => {}

pointerColor

Color of tooltip pointer, it defaults to the backgroundColor if none is passed .

TypeDefault
stringbackgroundColor

popover

Component to be rendered as the display container.

TypeDefault
React.Elementnull

toggleOnPress

Flag to determine to toggle or not the tooltip on press.

TypeDefault
booleantrue

width

Tooltip container width. Necessary in order to render the container in the correct place. Pass height according to the size of the content rendered inside the container.

TypeDefault
numbernumber150

withOverlay

Flag to determine whether or not dislay overlay shadow when tooltip is open.

TypeDefault
booleantrue

overlayColor

Sets backgroundColor of the overlay.

TypeDefault
stringrgba(250, 250, 250, 0.70)

withPointer

Flag to determine whether or not dislay pointer.

TypeDefault
booleantrue

toggleWrapperProps

Drills TouchableOpacity Props down to the TouchableOpacity wrapper that toggles the Tooltip.

TypeDefault
TouchableOpacityProps{}

tooltipPosition

Manually set tooltip position for rendering the tooltip w.r.t. content. Possible values include: -1 (AUTO POSITION), 0 (TOP LEFT), 1 (TOP RIGHT), 2 (BOTTOM RIGHT) and 3 (BOTTOM LEFT)

TypeDefault
number-1

MIT Licensed

1.0.3

3 months ago

1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

3 years ago