Typesafe HTML DSL Example
Want to use HTML in your app? Just a small post for today. Using Typesafe HTML DSL , you can do this: Full (small) code listing: package ... import android.webkit.WebView import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.padding import androidx.compose.material3.Card import androidx.compose.material3.Scaffold import androidx.compose.runtime. Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.compose.ui.viewinterop.AndroidView import kotlinx.html.* import kotlinx.html.dom.* import org.w3c.dom.Document object CoolLittleHtmlExample { private fun createHtmlPage () = createHTMLDocument (). html { head { title = "My Cool little HTML Kotlin Page" // Not displayed } body { h1 { + "Hello from D9!" } p { + "This is a paragraph generated by HTML DSL." } b { + "Let's be bold " } i ...