Coder Social home page Coder Social logo

rn-tooltip's Introduction

rn-tooltip

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 orionpro/rn-tooltip --save

or

npm install orionpro/rn-tooltip --save

Usage

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

...

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

Props


Reference

backgroundColor

sets backgroundColor of the tooltip and pointer.

Type Default
string #617080

containerStyle

Passes style object to tooltip container

Type Default
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.

Type Default
number string

highlightColor

Color to highlight the item the tooltip is surrounding.

Type Default
string transparent

onClose

function which gets called on closing the tooltip.

Type Default
function () => {}

onOpen

function which gets called on opening the tooltip.

Type Default
function () => {}

pointerColor

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

Type Default
string backgroundColor

pointerStyle

Passes style object to tooltip pointer view

Type Default
object (style) inherited styling

popover

Component to be rendered as the display container.

Type Default
React.Element null

actionType

Flag to determine how the tooltip reacts to presses.

Type Default
press or none or longPress press

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.

Type Default
number number

withOverlay

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

Type Default
boolean true

overlayColor

Sets backgroundColor of the overlay.

Type Default
string rgba(250, 250, 250, 0.70)

withPointer

Flag to determine whether or not dislay pointer.

Type Default
boolean true

toggleWrapperProps

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

Type Default
TouchableOpacityProps {}

MIT Licensed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.