Home > Software design >  How to use Compose-Web with Compose Widgets(Rows and Columns)?
How to use Compose-Web with Compose Widgets(Rows and Columns)?

Time:08-25

Recently I tried Compose-Web but was not able to do anything good as my Jetpack Compose knowledge was of no use(I'm Android Developer) since all HTML-related components were being used.

But initially I heard that there are two ways to make a compose-web project

  1. Using DOM API(HTML components like Div, Span, etc)
  2. Using Compose Widgets(Rows, Columns)

Is the second method still valid? if yes how can I use it in the project because by default IntelliJ is providing HTML components.

How to make Compose-web application as an Android Developer? I'm asking this here because there is very less content available about compose web on the internet.

CodePudding user response:

The ability to use compose.ui widgets with the js target is currently in the experimental stage. You can check it out in action as part of this experimental multiplatform example:

https://github.com/JetBrains/compose-jb/tree/master/experimental/examples/falling-balls-mpp

(there used to be a standalone js version in the top-level examples directory, but it got merged and now all the links to it are broken on the compose for web landing pages)

I've verified that it works after upgrading the webpack version to 4.10 in the build.gradle.kts file. Messing around with it myself, I noticed TODOs popping up in the console and it responding slowly to rapid page resizing, so I wouldn't think about using it for production use just yet.

  • Related