{"id":19164536,"url":"https://github.com/codemotionapps/react-native-webview-alternative","last_synced_at":"2025-05-07T12:13:37.236Z","repository":{"id":38886128,"uuid":"265607223","full_name":"codemotionapps/react-native-webview-alternative","owner":"codemotionapps","description":"Alternative to react-native-webview","archived":false,"fork":false,"pushed_at":"2023-01-06T06:34:47.000Z","size":3841,"stargazers_count":3,"open_issues_count":28,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-07T12:13:29.666Z","etag":null,"topics":["android","ios","react","react-native","reactjs","typescript","webview"],"latest_commit_sha":null,"homepage":"","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/codemotionapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-20T15:25:36.000Z","updated_at":"2024-11-27T12:33:13.000Z","dependencies_parsed_at":"2023-02-05T13:17:06.307Z","dependency_job_id":null,"html_url":"https://github.com/codemotionapps/react-native-webview-alternative","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemotionapps%2Freact-native-webview-alternative","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemotionapps%2Freact-native-webview-alternative/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemotionapps%2Freact-native-webview-alternative/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemotionapps%2Freact-native-webview-alternative/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemotionapps","download_url":"https://codeload.github.com/codemotionapps/react-native-webview-alternative/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252873884,"owners_count":21817715,"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":["android","ios","react","react-native","reactjs","typescript","webview"],"created_at":"2024-11-09T09:22:37.446Z","updated_at":"2025-05-07T12:13:37.215Z","avatar_url":"https://github.com/codemotionapps.png","language":"Objective-C","readme":"# react-native-webview-alternative\n\n[![npm version](https://img.shields.io/npm/v/react-native-webview-alternative.svg)](https://www.npmjs.com/package/react-native-webview-alternative)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n\nAlternative to react-native-webview. Less features. No Windows or macOS support. Not included in Expo.\n\n## Installation\n\n```sh\nnpm install react-native-webview-alternative\n(cd ios \u0026\u0026 pod install) # for iOS\n```\n\n## Usage\n\n```js\nimport WebView from \"react-native-webview-alternative\";\n\n\u003cWebView\n\tsource={{ html: '\u003ch1\u003eHello World\u003c/h1\u003e' }}\n\tstyle={{ width: 300, height: 300 }}\n/\u003e\n```\n\n## Props\n\nExtends [`ViewProps`](https://reactnative.dev/docs/view).\n\n### `source`\n\nLoad HTML into the WebView.\n\n#### Properties\n\n- `html` (string) - The string to use as the contents of the webpage\n- `baseURL` (string or undefined) - A URL used to resolve relative URLs within the document\n\n|Type|Required|Default value|\n|----|--------|-------------|\n|object|No|`null`|\n\n### `scrollEnabled`\n\nWhen set to `false` disables scrolling and pinch to zoom. Make sure to add `maximum-scale` to your viewport meta tag in order to prevent automatic scaling when focusing an input with a small font size on iOS.\n\n|Type|Required|Default value|\n|----|--------|-------------|\n|boolean|No|`true`|\n\n### `onLoad`\n\nCalled when page finishes loading.\n\n|Type|Required|\n|----|--------|\n|function|No|\n\n### `onMessage`\n\nCalled when a message is sent from the webview.\n\n#### iOS\n\nUse `webkit.messageHandlers.jsMessageHandler.postMessage(message)` to send your message. Supported types are object, string, number, and boolean. You will receive `message` as a property of `nativeEvent`.\n\n#### Android\n\nUse `JSBridge.postString(string)` to send a string. Use `JSBridge.postNumber(number)` to send a number. Use `JSBridge.postBoolean(boolean)` to send a boolean. Use `JSBridge.postNull()` to send `null`. You will receive your message as a property of `nativeEvent`.\n\n|Type|Required|\n|----|--------|\n|function|No|\n\n### `keyboardDisplayRequiresUserAction`\n\nWhen set to `false` allows [`HTMLElement.focus()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus), and [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autofocus) to display the keyboard.\n\n|Type|Required|Default value|Platform|\n|----|--------|-------------|--------|\n|boolean|No|`true`|iOS|\n\n### `hideKeyboardAccessoryView`\n\nWhen set to `true` this will hide the default keyboard accessory view.\n\n|Type|Required|Default value|Platform|\n|----|--------|-------------|--------|\n|boolean|No|`false`|iOS|\n\n## Methods\n\n### `focus()`\n\n```typescript\nfocus()\n```\n\n#### Android\nCalls [`requestFocus()`](https://developer.android.com/reference/android/webkit/WebView#requestFocus(int,%20android.graphics.Rect)) and shows the keyboard.\n\n#### iOS\nCalls [`HTMLElement.blur()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/blur) and [`HTMLElement.focus()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus) on [`document.activeElement`](https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/activeElement). It won't work if [`keyboardDisplayRequiresUserAction`](#keyboardDisplayRequiresUserAction) is `true` or if [`document.activeElement`](https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/activeElement) is not focusable. It is recommended to just focus your field from JavaScript instead of calling this method, calling blur beforehand may be required.\n\n### `injectJavaScript()`\n\n```typescript\ninjectJavaScript(string: string)\n```\n\nExecutes the JavaScript string.\n\n### `scrollTo()`\n\n```typescript\nscrollTo(options?: {x?: number, y?: number, animated?: boolean})\n```\n\nScrolls to a given x, y offset, either immediately or with a smooth animation.\n\nBy default x and y are `0`, animated is `true`.\n## Requirements\n\n- React Native 0.60 or later\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemotionapps%2Freact-native-webview-alternative","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemotionapps%2Freact-native-webview-alternative","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemotionapps%2Freact-native-webview-alternative/lists"}