{"id":18339858,"url":"https://github.com/rnkit/rnkit-alert-view","last_synced_at":"2025-04-06T05:32:22.392Z","repository":{"id":135844405,"uuid":"75615837","full_name":"rnkit/rnkit-alert-view","owner":"rnkit","description":"React Native Alert View component for iOS + Android","archived":false,"fork":false,"pushed_at":"2017-11-01T08:20:51.000Z","size":472,"stargazers_count":26,"open_issues_count":3,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T08:01:42.144Z","etag":null,"topics":["alertview","react-native","rnkit"],"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/rnkit.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-05T10:51:17.000Z","updated_at":"2021-06-01T16:36:40.000Z","dependencies_parsed_at":"2023-04-04T09:57:12.854Z","dependency_job_id":null,"html_url":"https://github.com/rnkit/rnkit-alert-view","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnkit%2Frnkit-alert-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnkit%2Frnkit-alert-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnkit%2Frnkit-alert-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnkit%2Frnkit-alert-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rnkit","download_url":"https://codeload.github.com/rnkit/rnkit-alert-view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247440612,"owners_count":20939223,"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":["alertview","react-native","rnkit"],"created_at":"2024-11-05T20:19:39.226Z","updated_at":"2025-04-06T05:32:21.473Z","avatar_url":"https://github.com/rnkit.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm][npm-badge]][npm]\n[![react-native][rn-badge]][rn]\n[![MIT][license-badge]][license]\n[![bitHound Score][bithound-badge]][bithound]\n[![Downloads](https://img.shields.io/npm/dm/rnkit-alert-view.svg)](https://www.npmjs.com/package/rnkit-alert-view)\n\nThe best AlertView for [React Native][rn].\n\n[**Support me with a Follow**](https://github.com/simman/followers)\n\n\n![](https://github.com/rnkit/rnkit-alert-view/blob/master/screen/android.gif?raw=true)\n![](https://github.com/rnkit/rnkit-alert-view/blob/master/screen/ios.gif?raw=true)\n\n[npm-badge]: https://img.shields.io/npm/v/rnkit-alert-view.svg\n[npm]: https://www.npmjs.com/package/rnkit-alert-view\n[rn-badge]: https://img.shields.io/badge/react--native-v0.28-05A5D1.svg\n[rn]: https://facebook.github.io/react-native\n[license-badge]: https://img.shields.io/dub/l/vibe-d.svg\n[license]: https://raw.githubusercontent.com/rnkit/rnkit-alert-view/master/LICENSE\n[bithound-badge]: https://www.bithound.io/github/rnkit/rnkit-alert-view/badges/score.svg\n[bithound]: https://www.bithound.io/github/rnkit/rnkit-alert-view\n\n## Getting Started\n\nFirst, `cd` to your RN project directory, and install RNMK through [rnpm](https://github.com/rnpm/rnpm) . If you don't have rnpm, you can install RNMK from npm with the command `npm i -S rnkit-alert-view` and link it manually (see below).\n\n### iOS\n\n* ####React Native \u003c 0.29 (Using rnpm)\n\n  `rnpm install rnkit-alert-view`\n\n* ####React Native \u003e= 0.29\n  `$npm install -S rnkit-alert-view`\n\n  `$react-native link rnkit-alert-view`\n\n\n\n#### Manually\n1. Add `node_modules/rnkit-alert-view/ios/RNKitAlertView.xcodeproj` to your xcode project, usually under the `Libraries` group\n1. Add `libRNKitAlertView.a` (from `Products` under `RNKitAlertView.xcodeproj`) to build target's `Linked Frameworks and Libraries` list\n\n\n\n### Android\n\n* ####React Native \u003c 0.29 (Using rnpm)\n\n  `rnpm install rnkit-alert-view`\n\n* ####React Native \u003e= 0.29\n  `$npm install -S rnkit-alert-view`\n\n  `$react-native link rnkit-alert-view`\n\n#### Manually\n1. JDK 7+ is required\n1. Add the following snippet to your `android/settings.gradle`:\n\n  ```gradle\ninclude ':rnkit-alert-view'\nproject(':rnkit-alert-view').projectDir = new File(rootProject.projectDir, '../node_modules/rnkit-alert-view/android/app')\n  ```\n  \n1. Declare the dependency in your `android/app/build.gradle`\n  \n  ```gradle\n  dependencies {\n      ...\n      compile project(':rnkit-alert-view')\n  }\n  ```\n  \n1. Import `import io.rnkit.alertview.AlertViewPackage;` and register it in your `MainActivity` (or equivalent, RN \u003e= 0.32 MainApplication.java):\n\n  ```java\n  @Override\n  protected List\u003cReactPackage\u003e getPackages() {\n      return Arrays.asList(\n              new MainReactPackage(),\n              new AlertViewPackage()\n      );\n  }\n  ```\n\nFinally, you're good to go, feel free to require `rnkit-alert-view` in your JS files.\n\nHave fun! :metal:\n\n## Basic Usage\n\nImport library\n\n```\nimport Alert from 'rnkit-alert-view';\n```\n\n### Code\n\n```jsx\nAlert.alert(\n      'Alert Title',\n      'alertMessage',\n      [\n        {text: 'Cancel', onPress: () =\u003e console.log('Cancel Pressed!'), style: 'cancel',},\n        {text: 'Ok', onPress: () =\u003e console.log('OK Pressed!')},\n        {text: 'Destructive', onPress: () =\u003e console.log('Destructive Pressed!'), style: 'destructive',},\n      ],\n    );\n```\n\n```jsx\nAlert.alert(\n      'Alert Title',\n      'alertMessage',\n      [\n        {text: 'Cancel', onPress: () =\u003e console.log('Cancel Pressed!'), style: 'cancel'},\n        {text: 'Ok', onPress: (text) =\u003e console.log('Ok Pressed!' + text)},\n      ],\n      'plain-text',\n      '',\n      1\n    );\n```\n\n#### Params\n\n| Key | Type | Default | Description |\n| --- | --- | --- | --- |\n| title | string | '' | |\n| message | string | '' |  |\n| buttons | array (ButtonsArray) |  | |\n| type | string (AlertType) | 'default' |  |\n| placeholder | string | '' | |\n| doneButtonKey | number | 0 |  |\n\n- ButtonsArray\n\n```jsx\ntype ButtonsArray = Array\u003c{\n  text?: string,\n  onPress?: ?Function,\n  style?: AlertButtonStyle,\n}\u003e;\n```\n\n- AlertType\n\n```jsx\ntype AlertType = $Enum\u003c{\n  'default': string,\n  'plain-text': string\n}\u003e;\n```\n\n- AlertButtonStyle\n\n```jsx\ntype AlertButtonStyle = $Enum\u003c{\n  'default': string,\n  'cancel': string,\n  'destructive': string,\n}\u003e;\n```\n\n## Contribution\n\n- [@simamn](mailto:liwei0990@gmail.com) The main author.\n\n## Thanks\n\n[@saiwu-bigkoo](https://github.com/saiwu-bigkoo) - [Android-AlertView](https://github.com/saiwu-bigkoo/Android-AlertView) 仿iOS的AlertViewController\n[@adad184](https://github.com/adad184) - [MMPopupView](https://github.com/adad184/MMPopupView) Pop-up based view(e.g. alert sheet), can easily customize.\n\n## Questions\n\nFeel free to [contact me](mailto:liwei0990@gmail.com) or [create an issue](https://github.com/rnkit/rnkit-alert-view/issues/new)\n\n\u003e made with ♥\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnkit%2Frnkit-alert-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frnkit%2Frnkit-alert-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnkit%2Frnkit-alert-view/lists"}