https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
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
    h
    p
    • 4
    • 10
  • p

    Piotr Krzemiński

    02/13/2023, 7:54 AM
    Hi, are you aware of any proper performance comparison between Compose for Web and other mainstream things like React, Angular and so on?
    c
    d
    • 3
    • 7
  • b

    bashor

    02/14/2023, 9:48 AM
    https://kotlinlang.slack.com/archives/CDFP59223/p1676367750876649
    a
    • 2
    • 2
  • b

    bashor

    02/15/2023, 8:45 PM
    https://kotlinlang.slack.com/archives/CDFP59223/p1676493882267159
    o
    s
    • 3
    • 2
  • a

    andylamax

    02/16/2023, 9:15 AM
    All the examples in https://github.com/JetBrains/compose-jb/tree/master/experimental/examples, are using
    kotlin {
      js(IR) {
        browser()
        binaries.executable()
      }
    }
    instead of
    kotlin {
      wasm {
        browser()
        binaries.executable()
      }
    }
    this seems a bit off
    o
    • 2
    • 6
  • z

    zfan93

    02/17/2023, 6:21 AM
    hi,i want use dependencies from npm,which write with js like below :
    // Include Lightbox 
    import PhotoSwipeLightbox from '/photoswipe/photoswipe-lightbox.esm.js';
    
    const lightbox = new PhotoSwipeLightbox({
      // may select multiple "galleries"
      gallery: '#gallery--getting-started',
    
      // Elements within gallery (slides)
      children: 'a',
    
      // setup PhotoSwipe Core dynamic import
      pswpModule: () => import('/photoswipe/photoswipe.esm.js')
    });
    lightbox.init();
    How do I define it in kotlin with @JsModule("") ?This seems a lot more complicated than the example on the website....Many thanks!!😒aluting_face:
    d
    b
    • 3
    • 9
  • a

    Arjan van Wieringen

    02/17/2023, 8:22 AM
    How can I specify which target to use for
    compose.web.targets
    ? I have multiple JS targets, and as such I need to specify it, but I can't find any way on how to do this? EDIT: apparently this works:
    compose.web {
        targets(kotlin.js())
    }
  • s

    Slackbot

    02/17/2023, 10:11 PM
    This message was deleted.
    a
    • 2
    • 1
  • a

    andylamax

    02/19/2023, 7:56 AM
    Is there a way to disable webpack's auto reloading?? It really doesn't help while doing compose 4 Web at all. I am trying to see if disabling it might give me more iteration speed
    a
    • 2
    • 4
  • s

    Slackbot

    02/21/2023, 11:37 AM
    This message was deleted.
    o
    d
    • 3
    • 2
  • w

    Waqas Tahir

    02/24/2023, 10:57 AM
    What's the future plan for compose web , At the moment compose uses skia , It has a huge wasm file which takes some time to load on a device , Its a huge turn off for web development with compose ui elements , Will compose UI support html rendering like flutter does or any other plans ?...
    o
    b
    • 3
    • 2
  • d

    Daniele B

    02/24/2023, 12:48 PM
    Can you point out a good sample for getting started with Compose for Web Canvas ?
    o
    a
    • 3
    • 8
  • d

    David Herman

    02/27/2023, 5:55 PM
    Hi web devs! Some of you may know I've been working on a project called Kobweb. If you don't, Kobweb adds an opinionated layer on top of C4W (when targeting the DOM). The experience was designed from the ground up around live reloading. Additionally, it adds features like routing, a Modifier concept that wraps CSS APIs (plus Row, Column, and Box implementations), exporting (for SEO), a color-mode-aware (e.g. light and dark) UI library, and a bunch more. Not 1.0 quite yet but getting there. JB was nice enough to add a channel for my project recently. If you wanted to give Kobweb a try, ask questions, or share thoughts, you're welcome to join → #kobweb
  • u

    정세현

    02/28/2023, 8:21 AM
    Hi everyone! I'm using compose web with skiko canvas I want to solve the following some problems. 1. Display Image -> I solved it using the svg to compose plugin. Is there any other general-purpose method? 2. Change Font 3. Change the mouse cursor icon according to the over of the button in the skiko canvas. what should I do?
    o
    d
    • 3
    • 7
  • d

    darkmoon_uk

    02/28/2023, 10:36 AM
    ✨ Lottie Animation on Web Canvas ✨ Scrappy code here
    e
    s
    +3
    • 6
    • 21
  • d

    darkmoon_uk

    03/02/2023, 1:39 PM
    Anyone know how best to load an SVG in Compose for Web (Canvas)? Looking to add it to this canvas of capabilities
    d
    • 2
    • 3
  • s

    spierce7

    03/03/2023, 9:28 PM
    Is it possible to embed and position dom elements inside compose canvas web?
    d
    • 2
    • 3
  • d

    darkmoon_uk

    03/04/2023, 5:49 AM
    💁 SVG example added to my scrappy 'Canvas of capabilities' 🎉 [Code]
    n
    • 2
    • 2
  • s

    spierce7

    03/06/2023, 1:49 AM
    At the top of my wish-list for Kotlin-conf next month is a vague high-level timeline/roadmap for compose web 😄
  • d

    Dirk Hoffmann

    03/06/2023, 11:44 AM
    Is there a *androidx.compose.ui.window.Dialog "*drop in" Component for compose-web which I can use out-of-the-box ??
    d
    • 2
    • 1
  • s

    Sean Proctor

    03/07/2023, 2:16 PM
    I'm having an issue with Compose and KSP 1.0.9 that only happens on my JS target (it could be because JS is my only target that depends on KSP in a multiplatform module). I can stick with KSP 1.0.8 for now, but that means I'm stuck on Kotlin 1.8.0. I'm not sure if it's a Compose or KSP issue. I made a report and reproduction here: https://github.com/google/ksp/issues/1314
    d
    • 2
    • 2
  • n

    Nick P

    03/08/2023, 1:26 AM
    Can anyone point to educational material (talks, demos, etc) for compose-web to supplement what's available at https://github.com/JetBrains/compose-multiplatform/tree/master/tutorials/Web ?
    d
    • 2
    • 3
  • r

    ribesg

    03/09/2023, 2:31 PM
    When using compose-web for the dom, how do you organize your style? Just inline everything on tags? One big
    StyleSheet
    instance? I would like to define my style with a
    StyleSheet
    per component but using
    Style(stylesheet)
    in each component creates a lot of empty
    <style>
    dom elements. I'm just playing with compose and trying to know how people do things
    b
    a
    +2
    • 5
    • 11
  • g

    Giorgi

    03/13/2023, 4:34 PM
    How can I render Japanesse or Chinese fonts in CfW compose? you can see the attached pic, it should say 【Spirits】-『如果這是無法反抗的命運的話 我會為了你而活下去』
    a
    d
    • 3
    • 9
  • a

    Alina Dolgikh [JB]

    03/15/2023, 1:34 PM
    set the channel topic: Compose for Web
  • a

    Alina Dolgikh [JB]

    03/15/2023, 1:39 PM
    Hi everyone! Here is an updated description for this channel. You can find more information about updates made for the community in the #compose channel.
  • a

    Alina Dolgikh [JB]

    03/15/2023, 1:39 PM
    🆕 Description of the channel Discussions about using Compose for web development: • How to integrate Compose with browsers. • How to distribute web Compose applications. • How to load resources in Compose for Web. If a discussion is not limited to web development and could be relevant to other platforms, it is better to use the #compose channel. If you want to call attention to an issue, please report it in the issue tracker of the project you are using. If you want to ask a question and think that it could be posted on StackOverflow, consider posting it there to make the question more discoverable for other people. Please use the relevant tag [compose]. Compose Multiplatform :compose: Project page :ladybug: Issue tracker 🎁 Releases
  • a

    Alina Dolgikh [JB]

    03/15/2023, 1:41 PM
    set the channel description: https://kotlinlang.slack.com/archives/C01F2HV7868/p1678887590205449
  • b

    benkuly

    03/15/2023, 1:46 PM
    Are there plans to fix this skiko TODO regarding clipboard on JS?
    o
    • 2
    • 3
  • s

    SrSouza

    03/17/2023, 12:51 PM
    Hi folks, there is any example of using Interop between Compose Skia Canvas and Compose DOM? There is support for that? Compose DOM uses only the Compose Runtime, so should be able to use both side by side, right?
    c
    a
    +2
    • 5
    • 8
Powered by Linen
Title
s

SrSouza

03/17/2023, 12:51 PM
Hi folks, there is any example of using Interop between Compose Skia Canvas and Compose DOM? There is support for that? Compose DOM uses only the Compose Runtime, so should be able to use both side by side, right?
c

CLOVIS

03/17/2023, 1:11 PM
I don't think you can use both at the same time because they have different Appliers. I'm not an expert though so I could be wrong
It's maybe possible to create a
Canvas
composable to switch between them
s

SrSouza

03/17/2023, 1:19 PM
Yes, they have different appliers, I’m not looking for use a directly 1/1 used, I’m looking if is possible to use currently, if there is not issues with dependencies. I’m thinking in a API more like this:
Box(modifer ...) {
  DomInterop(...) {
      DomDivComposable()
  }
}
Div(...) {
  CanvasInterop(..){
     MaterialButton()
     MultiplatformComponent()
  }
}
c

CLOVIS

03/17/2023, 1:21 PM
I'm pretty sure it's possible to write a
CanvasInterop
composable but I don't know how to.
To my knowledge they are not part of the library
a

Arjan van Wieringen

03/17/2023, 1:53 PM
Here is someone who integrated Compose Canvas with Compose Web: https://kotlinlang.slack.com/archives/C01F2HV7868/p1660083398571449
o

Oliver.O

03/17/2023, 9:22 PM
The above example integrates Compose Web UI/Canvas with the browser's DOM. It does not relate to or integrate with Compose Web/DOM. While in theory, you could have multiple Composers (one for UI/Canvas, one for DOM), I'm not sure if that would currently go too much against the grain. Look at a setup sequence to get Compose up and running:
GlobalSnapshotManager.ensureStarted(testScope)

        withContext(headlessMonotonicFrameClock(fps)) {
            val recomposer = Recomposer(coroutineContext)
            val composition = Composition(applier, recomposer)

            try {
                composition.setContent {
                    // This is the place to insert the initial Composable
                }

                recomposer.runRecomposeAndApplyChanges() // <- This method will not return
                // unless the Recomposer is closed and all effects in managed compositions
                // complete.
            } finally {
                composition.dispose()
                GlobalSnapshotManager.stop()
            }
        }
So suppose we'd use different coroutines to start up multiple Composers (which would be possible even in single-threaded environments). Then each Composer makes assumptions about how to schedule updates, and these assumptions depend on the frame clock. I'm not sure whether that works with multiple Composers unaware of each other but depending on the same frame clock.
s

shikasd

03/19/2023, 5:52 AM
Nesting different compositions with different appliers together is fairly simple and is supported already (just make sure to provide the correct applier in the constructor of composition) The problem is to arrange resulting canvas and dom visually on top of each other, which should be possible, but you'll have to play with positioning of root elements for each a little bit
View count: 30