{"id":4235,"url":"https://github.com/beefe/react-native-popupwindow","last_synced_at":"2025-08-09T08:07:49.967Z","repository":{"id":57339183,"uuid":"52591022","full_name":"beefe/react-native-popupwindow","owner":"beefe","description":"Android PopupWindow for react-native module","archived":false,"fork":false,"pushed_at":"2016-12-02T03:47:59.000Z","size":103,"stargazers_count":41,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-04T21:24:46.113Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/beefe.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}},"created_at":"2016-02-26T08:45:54.000Z","updated_at":"2024-05-31T08:00:00.000Z","dependencies_parsed_at":"2022-09-01T20:11:56.529Z","dependency_job_id":null,"html_url":"https://github.com/beefe/react-native-popupwindow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beefe/react-native-popupwindow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefe%2Freact-native-popupwindow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefe%2Freact-native-popupwindow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefe%2Freact-native-popupwindow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefe%2Freact-native-popupwindow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beefe","download_url":"https://codeload.github.com/beefe/react-native-popupwindow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefe%2Freact-native-popupwindow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268634064,"owners_count":24281896,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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:05.380Z","updated_at":"2025-08-04T00:32:34.214Z","avatar_url":"https://github.com/beefe.png","language":"Java","funding_links":[],"categories":["Components","Others"],"sub_categories":["UI"],"readme":"# react-native-popupwindow [![npm version](https://img.shields.io/npm/v/react-native-popupwindow.svg?style=flat-square)](https://www.npmjs.com/package/react-native-popupwindow)\nAndroid used PopupWindow implementation of the iOS-style dialog box\n\n### [简体中文](/README_zh_rCN.md)\n\n## Method\n\n### showPopupWindow(options,callback)\noptions : must be not null\n * windowColor : background color,default #50000000\n * style : show in activity center or bottom,default 0\n  * 0 : show in center\n  * 1 : show in bottom\n * margin : the distance from the screen\n * title : dialog title,default hide,only show when set value and style=0\n * titleTextSize : dialog title text size,default 17sp,only show when set value and style=0\n * titleTextColor : dialog title text color,only show when set value and style=0\n * single : only show when set value and style=0,default false\n  * false : has two button(positive and negative)\n  * true : single button(only has positive)\n * message : dialog message\n * messageTextSize : dialog message text size\n * messageTextColor : dialog message text color\n * positive : when style=0 and single=false,is left button、when single=true,only has this button; when style=1,is above button\n * positiveTextSize : positive button text size\n * positiveTextColor : positive button text color\n * negative : when style=0 and single=false,is right button、when single=true,this button will be hidden; when style=1,is below button\n * negativeTextSize : negative button text size\n * negativeTextColor : negative button text color\n\ncallback(err,action,button)\n* err : err message\n* action : return \"buttonClicked\"\n* button : return \"positive\" or \"negative\"\n\n## Install And Use\n\n#### Npm Install\n\n```shell\n$ npm install --save react-native-popupwindow\n```\n\n#### Add Link\n\n```shell\n$ react-native link react-native-popupwindow\n```\n\n#### Use\n\n```javascript\nimport React, { Component } from 'react';\n\nimport {\n  AppRegistry,\n  StyleSheet,\n  Text,\n  View,\n  ToastAndroid\n} from 'react-native';\n\nimport MyPop from 'react-native-popupwindow';\n\nlet options = {\n};\n\nclass PopupWindow extends Component {\n  center(){\n    options.style = 0;\n    MyPop.showPopupWindow(options,(err,action,button) =\u003e{\n          if(err){\n            ToastAndroid.show(err,ToastAndroid.SHORT);\n          }else{\n            if(action === 'buttonClicked'){\n                if(button === 'positive'){\n                  ToastAndroid.show('click ok',ToastAndroid.SHORT);\n                }else if(button === 'negative'){\n                  ToastAndroid.show('click cancel',ToastAndroid.SHORT);\n                }\n            }\n          }\n      });\n  }\n  bottom(){\n    options.style = 1;\n    MyPop.showPopupWindow(options,(err,action,button) =\u003e{\n          if(err){\n            ToastAndroid.show(err,ToastAndroid.SHORT);\n          }else{\n            if(action === 'buttonClicked'){\n                if(button === 'positive'){\n                  ToastAndroid.show('click ok',ToastAndroid.SHORT);\n                }else if(button === 'negative'){\n                  ToastAndroid.show('click cancel',ToastAndroid.SHORT);\n                }\n            }\n          }\n      });\n  }\n  render() {\n    return (\n        \u003cView style={styles.container}\u003e\n          \u003cText style={styles.welcome} onPress={this.center}\u003e\n              show in center\n           \u003c/Text\u003e\n          \u003cText style={styles.welcome} onPress={this.bottom}\u003e\n              show in bottom\n          \u003c/Text\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  welcome: {\n    fontSize: 20,\n    textAlign: 'center',\n    margin: 10,\n  },\n});\n\nAppRegistry.registerComponent('PopupWindow', () =\u003e PopupWindow);\n```\n\n## Run Renderings\n\n![rendering](/popup.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeefe%2Freact-native-popupwindow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeefe%2Freact-native-popupwindow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeefe%2Freact-native-popupwindow/lists"}