JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.15k stars 1.17k forks source link

[ASK] Is it possible to write and build android, window, macOS, web like Flutter? #2704

Closed chanjungkim closed 1 year ago

chanjungkim commented 1 year ago

in Flutter, you can build multi-platform apps with the same code and the same configuration.

I looked up KMP getting started. But It looks like it doesn't work that way. But more look like using Jetpack compose in Window or Android or macOS. And can't build for other platforms. Is that right?

If there's a way or additional work for each platforms but can work with one project, How can I achieve that?

eymar commented 1 year ago

You may use Compose Multiplatform to build an app to run on android and dekstop platofrms: window, macOS, linux. For those targets, you can share the most of the UI code.

Compose Multiplatform also provides "Compose for Web", which enables us to develop web apps using the same Composable approach, but the UI components API is different (it mimics HTML). This UI code is web-only and it can't be shared with desktop and android.


Other than that, Compose Multiplatform has Experimental!!! targets. For example: "Compose for Web (Canvas)", or MacOS (with kotlin/native), IOS. The UI code for those can be reused between all targets. Here is an example of such an app: https://github.com/JetBrains/compose-jb/tree/master/experimental/examples/chat-mpp

eymar commented 1 year ago

Feel free to reopen this question if you want to follow up.

Closing this issue for now.

ti4n1993 commented 1 year ago

Can build for windows and linux with kotlin/native?

okushnikov commented 3 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.