Hello, I'm looking for Nikolai Igotti please. I'm ...
# compose-web
Hello, I'm looking for Nikolai Igotti please. I'm interested in integrating Kotlin Compose with the Vaadin framework, but unfortunately I lack knowledge on how the Kotlin Compose compiler plugin works and how it integrates with the concrete compose library implementation (such as compose-web). Anton Arhipov told me that Nikolai could offer me some docs/pointers/initial guidelines. Thank you 🙂
Nikolai Igotti
You can contact me instead of Nikolay. As far as I know Vaadin renders all components on server side. You want to wrap existing Vaadin components into @Composable functions?
Thank you for reaching out 🙂 That is exactly correct. Vaadin components exist primarily on JVM; that's the environment where the
functions will run and will create Vaadin classes, such as Button and Span. Perhaps the solution might be closer to Compose-Desktop because of targeting JVM? I think I'm looking for a document which explains in detail how exactly Compose observes the changes done to the MutableState, and how can I plug in with my Vaadin-related functions 🙂
Perhaps the solution might be closer to Compose-Desktop because of targeting JVM?
It is probably in between. You need a compose runtime library, which is built for JVM (desktop):
Copy code
import org.jetbrains.compose.compose

plugins {

repositories {

dependencies {
and use an approach, which is used for Compose Web for DOM (“compose” dom elements into some existing DOM container) You can look at an example how to integrate Compose with external UI framework. Also you can look at mosaic - it uses Compose (another fork of it) to build a console application.
You can look at an example
Note that code can be not optimal there. Instead of
, you might want something like
. But it is a good start.
Perfect, thank you, I'll study these resources 🙇
Couldn’t you just fork compose web and use your html classes (or kotlinx.html)?
@hfhbd that would make sense if I'd try to target client-side javascript. However, I'm trying to target server-side JVM Vaadin UI components.
Yeah, thats why replace js dom classes with kotlinx html (or your html lib). But the main implementation of compose dom runtime is the same.
I remember multiple cases of people implementing server-sided component with Compose. Here is an example https://github.com/criske/compose-ssr