{"id":4071,"url":"https://github.com/chirag04/react-native-tooltip","last_synced_at":"2025-04-04T18:05:45.915Z","repository":{"id":32281488,"uuid":"35856241","full_name":"chirag04/react-native-tooltip","owner":"chirag04","description":"A react-native wrapper for showing tooltips","archived":false,"fork":false,"pushed_at":"2021-03-17T15:18:43.000Z","size":143,"stargazers_count":288,"open_issues_count":21,"forks_count":71,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-30T08:18:58.926Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chirag04.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-19T03:08:12.000Z","updated_at":"2024-04-16T20:34:01.000Z","dependencies_parsed_at":"2022-07-13T02:30:33.980Z","dependency_job_id":null,"html_url":"https://github.com/chirag04/react-native-tooltip","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chirag04%2Freact-native-tooltip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chirag04%2Freact-native-tooltip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chirag04%2Freact-native-tooltip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chirag04%2Freact-native-tooltip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chirag04","download_url":"https://codeload.github.com/chirag04/react-native-tooltip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:00.169Z","updated_at":"2025-04-04T18:05:45.893Z","avatar_url":"https://github.com/chirag04.png","language":"Objective-C","funding_links":[],"categories":["Components","\u003ca name=\"Alter,-Prompt,-Action-\u0026-Dialog:-Native-Modules\"\u003eAlter, Prompt, Action \u0026 Dialog: Native Modules\u003c/a\u003e","Others"],"sub_categories":["UI"],"readme":"# react-native-tooltip\n\nA react-native component from displaying tooltip. Uses UIMenuController.\n\n### Add it to your project\n\n1. Run `npm install react-native-tooltip --save`\n2. Open your project in XCode, right click on `Libraries` and click `Add\n   Files to \"Your Project Name\"` [(Screenshot)](http://url.brentvatne.ca/jQp8) then [(Screenshot)](http://url.brentvatne.ca/1gqUD).\n3. Add `libRNToolTipMenu.a` to `Build Phases -\u003e Link Binary With Libraries`\n   [(Screenshot)](http://url.brentvatne.ca/17Xfe).\n4. Whenever you want to use it within React code: `var ToolTip = require('react-native-tooltip');`\n\n## Usage\n\n### Props\n\n- `actions`: Array of actions `[{text: 'Copy', onPress: () =\u003e Clipboard.set(this.someValue) }]`\n- `longPress`: Boolean indicating if the tooltip should be showing on longPress, false by default.\n- `arrowDirection`: String indicating the direction of the tooltip arrow. Possible values are: `up`, `down`, `left`, `right`, and `default`. Default is `default`, which means to point up or down at the object of focus based on its location on the screen.\n\n#### Props from TouchableHighlight.propTypes\n\n- `activeOpacity`\n- `onHideUnderlay`\n- `onShowUnderlay`\n- `style`\n- `underlayColor`\n\nYou can see the list on the react native [website](https://facebook.github.io/react-native/docs/touchablehighlight.html#content)\n\n### Example\n\n```javascript\nimport React from 'react';\nimport {\n  AppRegistry,\n  StyleSheet,\n  PixelRatio,\n  View,\n  Text,\n} from 'react-native';\n\nimport ToolTip from 'react-native-tooltip';\n\nexport default class MyToolTip extends React.Component {\n    state = {\n        input: 'chirag'\n    };\n    \n    handleCopyPress = () =\u003e {\n        AlertIOS.alert(`Copy has been pressed!`);\n    };\n    \n    handleOtherPress = () =\u003e {\n        AlertIOS.alert(`Other has been pressed!`);\n    };\n    \n    handleHide = () =\u003e {\n        console.log('Tooltip did hide');\n    };\n    \n    handleShow = () =\u003e {\n        console.log('tooltip did show');\n    };\n    \n    render() {\n        return (\n          \u003cView style={{flex: 1, justifyContent: 'center'}}\u003e\n            \u003cToolTip\n              ref='tooltip'\n              actions={[\n                {text: 'Copy', onPress: this.handleCopyPress },\n                {text: 'Other', onPress: this.handleOtherPress }\n              ]}\n              onHide={this.handleHide}\n              onShow={this.handleShow}\n              underlayColor={'blue'}\n              style={styles.selectedName}\n            \u003e\n              \u003cText style={styles.welcome}\u003e\n                Press Here.\n              \u003c/Text\u003e\n            \u003c/ToolTip\u003e\n          \u003c/View\u003e\n        );\n    }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: '#F5FCFF',\n  },\n  textinputContainer: {\n    marginTop: 20,\n    justifyContent: 'center',\n    alignItems: 'center',\n  },\n  textinput: {\n    width: 60,\n    marginVertical: 2,\n    marginHorizontal: 2,\n    borderWidth: 1 / PixelRatio.get(),\n    borderRadius: 5,\n    borderColor: '#c7c7cc',\n    padding: 2,\n    fontSize: 14,\n    backgroundColor: 'white',\n  },\n});\n\nAppRegistry.registerComponent('tooltip', () =\u003e tooltip);\n```\n\n### Note\n\nIt is also possible to open the menu programmatically, by calling `this.refs.theToolTip.showMenu();` ( `theToolTip` being the reference of the component).\nTo hide menu `this.refs.theToolTip.hideMenu();` (Though tooltip hides by itself, while using with drawer on specific gesture tooltip does not hide by default.)\n\n## Here is how it looks:\n![Demo gif](https://github.com/chirag04/react-native-tooltip/blob/master/screenshot.png)\n\n### Special thanks\nSpecial thanks to [jrichardlai](https://github.com/jrichardlai) for refactoring the api and make it awesome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchirag04%2Freact-native-tooltip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchirag04%2Freact-native-tooltip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchirag04%2Freact-native-tooltip/lists"}