{"id":13522936,"url":"https://github.com/alantoa/universal-tooltip","last_synced_at":"2025-07-14T08:16:32.348Z","repository":{"id":65783558,"uuid":"581158371","full_name":"alantoa/universal-tooltip","owner":"alantoa","description":"Native behavior's cross-platform tooltip component. 🖕","archived":false,"fork":false,"pushed_at":"2024-05-09T09:34:01.000Z","size":5977,"stargazers_count":183,"open_issues_count":7,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-04T17:05:35.153Z","etag":null,"topics":["expo-modules","react-native","react-native-tooltip"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alantoa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-22T12:32:18.000Z","updated_at":"2025-06-03T21:38:23.000Z","dependencies_parsed_at":"2024-01-11T11:48:08.083Z","dependency_job_id":"ef971db3-04ce-4cda-86b6-03a324e77b73","html_url":"https://github.com/alantoa/universal-tooltip","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/alantoa/universal-tooltip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alantoa%2Funiversal-tooltip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alantoa%2Funiversal-tooltip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alantoa%2Funiversal-tooltip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alantoa%2Funiversal-tooltip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alantoa","download_url":"https://codeload.github.com/alantoa/universal-tooltip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alantoa%2Funiversal-tooltip/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265262561,"owners_count":23736414,"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":["expo-modules","react-native","react-native-tooltip"],"created_at":"2024-08-01T06:00:53.836Z","updated_at":"2025-07-14T08:16:32.290Z","avatar_url":"https://github.com/alantoa.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Libraries"],"sub_categories":["UI Components"],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"./assets/cover.png\" /\u003e \n  \n[![npm](https://img.shields.io/npm/l/universal-tooltip?style=flat-square)](https://www.npmjs.com/package/universal-tooltip) [![expo](https://img.shields.io/badge/Runs%20with%20Expo-4630EB.svg?style=flat-square\u0026logo=EXPO\u0026labelColor=f3f3f3\u0026logoColor=000)](https://expo.io/)\n\n\u003c/div\u003e\n\n###### Works on all platforms, Example project [here](https://github.com/alantoa/universal-tooltip/tree/main/example).\n\n| iOS | Android | Web |\n| - | - | - |\n| \u003cvideo src=\"https://user-images.githubusercontent.com/37520667/264635061-2e9deb58-5141-46f7-99b4-34547972ab6f.mp4\" /\u003e | \u003cvideo src=\"https://user-images.githubusercontent.com/37520667/264636954-c2471a5c-3f28-4a53-8dac-eb9d97a51ebd.mp4\" /\u003e | \u003cvideo src=\"https://user-images.githubusercontent.com/37520667/264636470-f2198e04-a6a2-48b7-bd64-45763f48f947.mp4\" /\u003e |\n \n\n\n## What\n\nThis is a pure and simple native tooltip component that supports fadeIn and zoomIn preset animations.\n\n🍎 On iOS:\n\n- This component is written in Swift and wraps [`Popovers`](https://github.com/aheze/Popovers).\n\n🤖️ On Android:\n\n- This component is written in Kotlin and wraps the excellent library - [`Balloon`](https://github.com/skydoves/Balloon).\n\n🌐 On Web:\n\n- This component wraps [`@radix-ui/react-popover`](https://www.radix-ui.com/docs/primitives/components/popover) for mobile use.\n\n- This component wraps [`@radix-ui/react-tooltip`](https://www.radix-ui.com/docs/primitives/components/popover) for desktop use.\n\n\u003e Please note that the @radix-ui/react-tooltip component from Radix only works on desktop, as per [this thread](https://github.com/radix-ui/primitives/issues/955#issuecomment-960610209).\n\n## Usage\n\n```tsx\nimport { useState } from \"react\";\nimport * as Tooltip from \"universal-tooltip\";\nimport { Text, View, Pressable, Platform } from \"react-native\";\n\n// because each platform has different behaviors, but you can replace the components yourself, of course.\nconst TriggerView = Platform.OS === \"web\" ? View : Pressable;\n\nconst [open, setOpen] = useState(false);\n\n\u003cTooltip.Root\n  // For web, I would like to be triggered automatically with the mouse.\n  {...Platform.select({\n    web: {},\n    default: {\n      open,\n      onDismiss: () =\u003e {\n        console.log(\"onDismiss\");\n        setOpen(false);\n      },\n    },\n  })}\n\u003e\n  \u003cTooltip.Trigger\u003e\n    \u003cTriggerView\n      {...Platform.select({\n        web: {},\n        default: {\n          open,\n          onPress: () =\u003e {\n            setOpen(true);\n          },\n        },\n      })}\n    \u003e\n      \u003cText\u003eHello!👋\u003c/Text\u003e\n    \u003c/TriggerView\u003e\n  \u003c/Tooltip.Trigger\u003e\n  \u003cTooltip.Content\n    sideOffset={3}\n    containerStyle={{\n      paddingLeft: 16,\n      paddingRight: 16,\n      paddingTop: 8,\n      paddingBottom: 8,\n    }}\n    onTap={() =\u003e {\n      setOpen(false);\n      console.log(\"onTap\");\n    }}\n    dismissDuration={500}\n    disableTapToDismiss\n    side=\"right\"\n    presetAnimation=\"fadeIn\"\n    backgroundColor=\"black\"\n    borderRadius={12}\n  \u003e\n    \u003cTooltip.Text text=\"Some copy...\" style={{ color: \"#000\", fontSize: 16 }} /\u003e\n  \u003c/Tooltip.Content\u003e\n\u003c/Tooltip.Root\u003e;\n```\n\n## API\n\nThis component's API basically same as the [`@radix-ui/react-tooltip`](https://www.radix-ui.com/docs/primitives/components/popover) component, but there are some differences on native.\n\n## Installation\n\n```sh\nyarn add universal-tooltip\n```\n\n### Expo\n\n```sh\nexpo install universal-tooltip expo-build-properties\n```\n\nTo use this component, you need to add the expo-build-properties plugin to your app.json or app.config.js and ensure that your compileSdkVersion \u003e= 32 as required by the [Ballon lib](https://github.com/skydoves/Balloon). An example configuration might look like this:\n\n```json\n[\n  \"expo-build-properties\",\n  {\n    \"android\": {\n      \"compileSdkVersion\": 32,\n      \"targetSdkVersion\": 32,\n      \"minSdkVersion\": 23,\n      \"buildToolsVersion\": \"32.0.0\",\n      \"kotlinVersion\": \"1.6.10\"\n    },\n    \"ios\": {\n      \"deploymentTarget\": \"13.0\"\n    }\n  }\n]\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falantoa%2Funiversal-tooltip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falantoa%2Funiversal-tooltip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falantoa%2Funiversal-tooltip/lists"}