![JAR search and dependency download from the Maven repository](/logo.png)
commonMain.App.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compose-webview-multiplatform Show documentation
Show all versions of compose-webview-multiplatform Show documentation
WebView for JetBrains Compose Multiplatform
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import sample.BasicWebViewSample
import web.WebView
import web.rememberWebViewState
@Composable
internal fun App() {
// WebViewSample()
BasicWebViewSample()
// BasicWebViewWithHTMLSample()
}
@Composable
internal fun WebViewSample() {
MaterialTheme {
val webViewState = rememberWebViewState("https://developer.android.com/")
Column(Modifier.fillMaxSize()) {
val text = webViewState.let {
"${it.pageTitle ?: ""} ${it.loadingState} ${it.lastLoadedUrl ?: ""}"
}
Text(text)
WebView(
state = webViewState,
modifier = Modifier.fillMaxSize()
)
}
}
}
expect fun getPlatformName(): String
© 2015 - 2025 Weber Informatics LLC | Privacy Policy