New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-good-tooltip

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-good-tooltip

This tooltip was created with the best UX in mind.

latest
Source
npmnpm
Version
1.2.1
Version published
Maintainers
0
Created
Source

React Native Good Tooltip

Tooltips do not interrupt the user's flow. I'm not positive about the flow of using the app after touching the tooltip to close it. So this component doesn't use Modal.

Installation

npm install react-native-good-tooltip

Usage

⚠️Warning⚠️️ This component will need to be used with styles (z-Index and Overflow). You will immediately see the need for zIndex if you use "bottom" placement. Please refer to the example project and video.

import Tooltip from 'react-native-good-tooltip';


// ...

<Tooltip
  visible={true} // or false
  text="This is a tooltip"
  placement={'bottom'}
  anchor={'left'}
>
  {/* your component */}
</Tooltip>

Video

Props

Props

PropTypeDefaultDescription
visiblebooleanundefinedWhether the tooltip is visible.
rerenderKeyanyundefinedKey to force re-rendering of the tooltip.
placement'top' | 'bottom' | 'left' | 'right'requiredThe position of the tooltip relative to the anchor.
anchor'center' | 'left' | 'right' | 'top' | 'bottom''center'The alignment of the tooltip relative to the anchor.
offset{ position?: { x?: number, y?: number }, arrow?: { x?: number, y?: number } }undefinedThe offset for the tooltip and arrow position.
arrowElementReact.ReactElementundefinedCustom arrow element.
styles{color?: ColorValue | 'primary', containerStyle?: ViewStyle, tooltipStyle?: ViewStyle, arrowSize?: { width?: number, height?: number }, closeSize?: { width?: number, height?: number} }undefinedCustom styles for the tooltip.
textstring | React.ReactElementrequiredThe content of the tooltip.
childrenReact.ReactElementundefinedThe element to which the tooltip is anchored.
onPress() => voidundefinedFunction to call when the tooltip is pressed.
onVisibleChange(isVisible: boolean) => voidundefinedFunction to call when the visibility of the tooltip changes.
delayShowTimenumber0The delay time before showing the tooltip.
autoHideTimenumber5000The time after which the tooltip will automatically hide.
disableAutoHidebooleanfalseWhether to disable the auto-hide feature.
disablePressToClosebooleanfalseWhether to disable the press-to-close feature.
numberOfLinesnumber2The number of lines to display in the tooltip text.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Made with create-react-native-library

Keywords

react-native

FAQs

Package last updated on 01 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts