Skip to content

Compose Multiplatform WebView

Maven Central Kotlin Compose Multiplatform

badge-android badge-ios badge-desktop

This library provide a WebView widget for JetBrains Compose Multiplatform.

Note This library is built using the compose multiplatform library template. It supports automatic package publishing, documentation, and code style checking.

This library can be considered as the Multiplatform version of Accompanist Web library. It provides the basic WebView functionalities for JetBrains Compose Multiplatform, which supports loading URLs, HTML, and post data.

Currently, it supports the platforms of Android, iOS, and Desktop.

Android

The Android implementation of this library relies on the web module from the Accompanist Library.

Note: it has been deprecated in version 0.33.1-alpha. Thus I created a fork of it and used it as the base for this library. If you just want to use the WebView in Jetpack Compose, please visit this repo: https://github.com/KevinnZou/compose-webview.

iOS

The iOS implementation of this library relies on WKWebView.

Desktop

The Desktop implementation of this library relies on JavaFX WebView for version <= 1.2.0.

Thanks to @DATL4G, starting from version 1.3.0, we switched to Java CEF Browser for better performance.

Starting from version 1.7.0, we switched from Java CEF Browser to Kotlin CEF Browser for more features and better performance.

Note: After switching to KCEF, developers need to configure it for the desktop app. Please see the README.desktop.md for more details.

License

Copyright 2023 Kevin Zou

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.