npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-tooltipster

v1.0.0

Published

💬 Truely native tooltip for your React Native app 💬

Downloads

5

Readme

React Native Tooltipster

Installation

npm install react-native-tooltipster

# or with yarn

yarn add react-native-tooltipster

Next install CocoaPods deps:

npx pod-install ios

Usage

You can show tooltip for any component you want

import Tooltipster from 'react-native-tooltipster';

<Tooltipster
  text="Lorem Ipsum ipdoor"
  bgColor="#ffbd00"
>
  <Text>Hello world</Text>
</Tooltipster>

// Or

<Tooltipster
  text="Lorem Ipsum is simply dummy text of the printing and typesetting industry"
  bgColor="#ffbd00"
>
  <View>
    <Text>Hello world</Text>
    <Text>It's a good day</Text>
  </View>
</Tooltipster>

Props

animation

  • Description: tooltip show animation
  • Value: type SCALE | FADE. Default SCALE

arrowSize

  • Description: size of the arrow of tooltip
  • Value: type number. Default 10

position

  • Description: position of the arrow align to the anchor
  • Value: type top | right | bottom | left. Default bottom on Android, any (auto) on iOS

arrowPositionRules (Android only)

  • Description: align arrow by Anchor or bubble (the tooltip itself). This is useful in some cases where position=left|right
  • Value: type ALIGN_BUBBLE | ALIGN_ANCHOR. Default ALIGN_ANCHOR

text

  • Description: text of tooltip
  • Value: type string. Default "" (empty string)

textAlign

  • Description: text alignment
  • Value: type left | right | center. Default center

textLineHeight

  • Description: line height of the text
  • Value: type number. Default undefined

textColor

  • Description: text color
  • Value: type string. Default white

fontSize

  • Description: text font size
  • Value: type number. Default 12 on Android, 15 on iOS

fontWeight

  • Description: text font weight
  • Value: type BOLD | BOLD_ITALIC | ITALIC | NORMAL. Default NORMAL

cornerRadius

  • Description: tooltip border radius
  • Value: type number. Default 5

bgColor

  • Description: tooltip background
  • Value: type string. Default #1c7bf6

maxWidth

  • Description: tooltip max width
  • Value: type number. Default <SCREEN_WIDTH>

padding

  • Description: padding of the tooltip
  • Value: type {top?: number, right?: number, bottom?: number , left?: number}. Default undefined

margin

  • Description: margin of the tooltip
  • Value: type {top?: number, right?: number, bottom?: number , left?: number}. Default undefined

dismissOnClick

  • Description: dismiss the tooltip if click on itself
  • Value: type boolean. Default false

renderTemplate (iOS only)

  • Description: React component for the tooltip
  • Value: type Function. Default undefined

Example:

<Tooltipster
  bgColor="#7A316F"
  animation="FADE"
  renderTemplate={() => (
    <>
      <Text
        style={{ color: 'white', fontSize: 20, textAlign: 'center' }}
      >
        With React Component
      </Text>
      <Image
        source={require('./assets/bunny.jpg')}
        style={{
          width: 200,
          height: 100,
          resizeMode: 'stretch',
        }}
      />
    </>
  )}
>
  <TouchableOpacity
    style={[styles.button, { backgroundColor: '#7A316F' }]}
  >
    <Icon name={'arrowdown'} size={24} color={'white'} />
  </TouchableOpacity>
</Tooltipster>

Events

  • onClick: on click bubble (the tooltip)
  • onDismissed: on tooltip dismissed

Examples

Check out example folder for complete usage

Thanks