Coder Social home page Coder Social logo

qeepsake / react-native-action-tips Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 13.02 MB

Cross platform tooltip for React Native (with TypeScript)

Home Page: https://lukebrandonfarrell.com

JavaScript 48.87% TypeScript 49.01% Shell 2.12%
react-native tooltips tooltip popup javascript

react-native-action-tips's Introduction

react-native-action-tips

All Contributors

npm npm licence npm downloads

Cross platform tooltip for React Native.

Install

To get started install via npm:

 npm install react-native-action-tips --save

Usage

Import:

 import ActionTip from 'react-native-action-tips';

You can use the imperative API to control the action tip:

const actionTipRef = useRef(null);

<ActionTip
  ref={actionTipRef}
  position={{ top: 50 }}
/>

someMethod() {
  actionTipRef.current.show("Link has been copied");
}

The declarative API for controlling the action tip:

const [isVisible, setIsVisible] = useState(false);

<ActionTip
  visible={isVisible}
  text="Link has been copied"
  position={{ top: 50 }}
/>

Notes

The action tip exposes imperative show() and hide() functions.

The position of the component can be customised through the position prop by passing an object as such { top: 0, bottom: 0, left: 0, right: 0 }. By default the component uses "absolute" positioning. This can be changed by passing style through the containerStyle prop.

Props

Prop Type Optional Default Description
ref string Yes ref allows you to call the show() and hide() methods.
text string Yes Text which is displayed inside the action tip.
visible boolean Yes Controls the tooltip visibility.
duration number Yes 2000 ms Duration until the action tip dismisses.
animationInDuration number Yes 150 ms Duration of fade-in animation.
animationOutDuration number Yes 700 ms Duration of fade-out animation.
opacity number Yes 0.85 Maximum opacity the tip should animate to.
position object Yes 0 Absolute positioning of the component.
containerStyle style Yes Style applied to the action tip container.
textStyle style Yes Style applied to the action tip text.
onHide function Yes Callback when tooltip is hidden

Contributing

If you want to issue a PR, go ahead ;)

Authors

License

This project is licensed under the MIT License

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Luke Brandon Farrell

๐Ÿ“–

Gabriel Ribeiro

๐Ÿ›

This project follows the all-contributors specification. Contributions of any kind welcome!

react-native-action-tips's People

Contributors

allcontributors[bot] avatar sevenbytez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.