# compose-web

Sean Proctor

10/20/2021, 12:38 AM
Hi, I'm wonder if I could ask for some opinions. I've been working on an Android app for a couple of years that I ported to Compose. We started a web version of the app in Vue.js. I'm not very competent in JS (and even less so in Vue.js), but I'm quite comfortable with Kotlin and Compose. I'm contemplating using Compose for Web instead. Would my lack of JS skills be a big hindrance? I've written a Compose for Desktop app, but Compose for Web has the appearance of being much more daunting.

Casey Brooks

10/20/2021, 12:53 AM
While I haven't personally used it, Compose for Web basically replaces Vue/React/Angular for the task of applying data to HTML. But you'll still need to know HTML/CSS to make a web app with it, just like with those other frameworks. Unfortunately, for the time-being, Compose just modifies normal browser DOM and doesn't use the Material UI (though I believe there is a long-term roadmap to support Skia and use Material UI like with Desktop), but I don't think you'd need to know much JS to work with Compose Web, just HTML/CSS. However, there are KMP libraries for most of the typical browser APIs you'd normally need (API clients, key-value storage, and routing, for example), so you don't have to drop down into that untyped hellscape called the JS Standard Library.


10/20/2021, 1:07 AM
Yeah the heavy lift you'd need to do with Compose for Web, in its current state, is to 'Compose' your View layer from HTML+CSS. This isn't necessarily bad; it's perfectly feasible to build functional UI's from HTML elements and it does, mercifully, do away with a need to use JS at all. This already makes it a viable, even compelling tool for some use cases; particularly if you have a logic heavy client you want to share code between Mobile & Web.

Sean Proctor

10/20/2021, 1:33 AM
Thanks for the replies. There's not really a lot of logic to be shared, I think. The biggest parts are the layout and data synchronization, which I guess would be quite different between web and mobile targets.


10/20/2021, 6:52 AM
You might also consider Doodle; it doesn't require any HTML/CSS knowledge. Full disclosure: I'm the author.


10/20/2021, 8:37 AM
"Would my lack of JS skills be a big hindrance" - No. If you are comfortable with HTML/CSS then minimal Javascript knowledge may be enough. (Mainly for interfacing existing JS libraries.) Compose/Web works fairly well as a layer over the browser DOM. As others wrote, probably no canvas-based rendering will be available in the short term. But I think it is not a huge problem, for Compose/Web the main focus should be great integration with Web technologies (JS, CSS, DOM) and the ability to easily integrate existing JS libraries and eg. React components. I would definitely try it, at least evaluating if it fits your needs. It is a huge win that you can use Kotlin and Compose in the browser, with all "usual" frameworks and solutions (eg. coroutines). And some months ago a JB developer wrote that there may be a final version soon: To tell the truth, I would not use "custom" Kotlin frameworks, if you decide to not go with Compose/Web then maybe consider the ReactJS wrappers:

Sean Proctor

10/20/2021, 12:58 PM
@Norbi Thanks for your really detailed response. I don't mind HTML/CSS. It would be nice if I could use my existing components, but that's not possible with any other framework. I guess I could give it a try, the only thing to lose is some time.
👍 1
compose desktop 1
👍🏻 1
jetpack compose 1

Greg Steckman

10/21/2021, 3:04 PM