https://kotlinlang.org logo
#compose-web
Title
# compose-web
a

Archie

02/08/2023, 6:10 AM
hi all, general question, is there a way to share compose components web, android and desktop? any advice on how to do this if its possible?
c

CLOVIS

02/08/2023, 8:12 AM
There are two Compose for Web: DOM (called core) and Canvas. It is possible to share a lot of components between Canvas, Desktop and Android, but it's quite experimental. Compose for Web DOM is ready to use, but it cannot share components with the other platforms.
a

Archie

02/08/2023, 8:14 AM
Thanks. I havent heard about Canvas, I’ll check it out.
Thank you very much
c

CLOVIS

02/08/2023, 8:15 AM
Of course, you could expect/actual all your components, in which case you could use all platforms, but that's a lot of work.
I'm actually attempting it 🫣 but it's nowhere near ready to use. https://gitlab.com/opensavvy/decouple
h

hfhbd

02/08/2023, 8:58 AM
Yeah, expect/actual theoretical work but it does not scale and biggest problem is Modifer support
p

Pablichjenkov

02/08/2023, 12:35 PM
If you want to jump into experimental waters. Same compose-ui code running on all the platforms. This is the official examples: https://github.com/JetBrains/compose-jb/tree/master/experimental%2Fexamples
a

Archie

02/08/2023, 12:46 PM
This is very interesting. Is there an official statement about these sample? And how they plan to make them official?
p

Pablichjenkov

02/08/2023, 12:55 PM
I really don't know. You can browse the repo see if you can find some documentation in that regards. Even though they are experimental I don't expect drastic changes in their final versions, although I am not the most indicated to assure that. You may ask about those concerns in this channel or the #multiplatform or #compose-mp channels.
a

Archie

02/08/2023, 12:56 PM
Thank you
46 Views