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
  • m

    MrPowerGamerBR

    08/30/2021, 2:23 PM
    Did anyone have issues with "onClick" not working on iOS (Safari) devices? iOS users are saying that clicking doesn't do anything, but it works fine under Firefox or Chrome
    • 1
    • 2
  • c

    Cicero

    09/01/2021, 7:58 AM
    Hello, what are you guys using for language localization?
    a
    • 2
    • 1
  • e

    ESchouten

    09/02/2021, 3:55 PM
    Interesting: @olonho doing important work making Skiko multiplatform (enabling compose canvas rendering on web + iOS) https://github.com/JetBrains/skiko/pull/150
    :kotlin-flag: 2
    :thank-you: 1
    😮 3
    ➕ 3
    🎉 22
    🚀 16
    👍 2
    m
    o
    j
    • 4
    • 4
  • n

    nordiauwu

    09/03/2021, 1:07 PM
    What does the "Wt" mean?
    👀 1
    👍 1
    d
    • 2
    • 1
  • l

    LeoColman

    09/03/2021, 6:21 PM
    Is it necessary to rerun the project everytime I want to test? Os is there a way to auto-reload?
    c
    • 2
    • 4
  • l

    LeoColman

    09/04/2021, 1:09 AM
    How to add a video to a webpage?
    b
    o
    • 3
    • 6
  • a

    Ayfri

    09/05/2021, 6:56 AM
    Hi, in a Row I have two boxes, is there a way to set the second box to the right side of the screen while keeping the first in the left side ?
    n
    c
    s
    • 4
    • 5
  • c

    CLOVIS

    09/10/2021, 9:00 PM
    Are
    compose.foundation
    and
    compose.material
    not available yet for JS? Gradle refuses to build if I put them in
    commonMain
    , saying the JS IR variants are missing.
    ➕ 2
    b
    s
    • 3
    • 24
  • c

    CLOVIS

    09/10/2021, 10:25 PM
    Taking a look at the
    compose.web.widgets
    source code, it is very bare at the moment (a few types of buttons/text, but no TextField etc). At the moment, is the recommended way to write multiplatform UIs? Is it to stick with it and expect-actual what it doesn't have, or completely ignore it?
    b
    • 2
    • 6
  • j

    João Martins

    09/11/2021, 1:48 AM
    Has anyone tried using Google One-tap sign in with compose web? ( https://developers.google.com/identity/gsi/web/guides/handle-credential-responses-js-functions ) What I want specifically is a button that calls a local function upon obtaining credentials, but no matter what I pass to
    data-callback
    , it errors saying that it isn't a function
    o
    • 2
    • 1
  • a

    adjpd

    09/11/2021, 8:09 PM
    Are there plans to port Google's material design components to the web at some point? I understand some of them work for desktop already?
    👍 1
    b
    f
    +5
    • 8
    • 24
  • n

    nordiauwu

    09/12/2021, 4:02 PM
    Is there a reason why the test-utils module isn't available in WebDependencies?
    o
    • 2
    • 1
  • v

    Vinay Gaba

    09/13/2021, 5:10 PM
    Does Compose for Web have an interoperability story that's as compelling as Compose for Android i.e can I leverage Compose for Web in an existing React website? If yes, any examples I can check? I think incremental adoption would be super powerful and I have a feeling that its most likely supported or at least on the roadmap?
    👀 1
    s
    j
    +3
    • 6
    • 13
  • t

    Tristan

    09/15/2021, 8:59 PM
    Hello people! I’ll go straight to the point 😄 I use the following code for CSS variables.
    object BoardCssVariable {
        val translateOrigin by variable<StylePropertyString>()
    }
    The current examples are use it in something like
    object BoardSheet : StyleSheet() {
        val container by style {
            BoardCssVariable.translateOrigin("translateY(-150%)")
            property("transform", BoardCssVariable.translateOrigin.value())
        }
    }
    But that’s not really useful. I want to change its value depending on some logic. So I ended up doing
    Div({
        style {
            if (myCondition) {
              property(BoardCssVariable.translateOrigin.name, "translateY(-150%)")
            }
        }
    }) {}
    Is there some ideas to make it more pleasant? Maybe Compose for web could get some handy features via the compiler, some kind of CSS runtime like Emotion? Of course, it is not blocking. Just curious to know what will be the team’s take on that 🙂 Maybe I could have done something like
    Div({
        classes(BoardSheet.container("translateY(-150%)"))
    }) {}
    and under the wood, the compiler would have done what I manually did. I don’t know 🤷
    a
    • 2
    • 1
  • e

    Emil Kantis

    09/15/2021, 9:10 PM
    Are there any sample compose-web project with a server-side component? Can a compose-web application be served from a ktor-instance that also handles incoming REST calls for instance? Most examples I found were "client-only" 🙂
    b
    s
    c
    • 4
    • 11
  • h

    Hugo Miguel Coutinho Dias

    09/16/2021, 4:40 PM
    Hey, when i updated to alpha4-build348 i started getting the following error: https://pastebin.com/rgfings1 Anybody getting this issue or have any idea on how to solve it? the cause seems to be this state
    val (modalState, setModalState) = remember { mutableStateOf<(@Composable () -> Unit)>({ loading() }) }
    👀 1
    o
    • 2
    • 4
  • s

    solidogen

    09/16/2021, 9:06 PM
    does tailwind work with compose web? I saw this https://github.com/nanodeath/kotlinjs-tailwindcss but I'm not sure how applicable it is to compose
    a
    • 2
    • 2
  • c

    CLOVIS

    09/22/2021, 8:14 PM
    I'm starting out with Compose for Web, and I found this:
    @Composable
    fun App() {
      var email by remember { mutableStateOf ("") }
    
      TextInput(email) {
        onChange { email = it.value }
      }
    }
    However,
    it.value
    is always an empty string. Am I doing something obviously wrong (like calling the wrong function), or is my problem more complicated?
    b
    m
    • 3
    • 14
  • s

    salomonbrys

    09/24/2021, 7:22 AM
    Hey guys, Is there an equivalent to React keys (https://reactjs.org/docs/lists-and-keys.html#keys) to ensure that, in a list, the same element is always rendered using the same dome node, even if elements are added or removed ? This is important for CSS animations.
    ✅ 1
    • 1
    • 1
  • l

    LeoColman

    09/24/2021, 8:20 PM
    How to export a compose web project to execute it outside a gradle environment? I want to host my compose website, but I couldn't find how to do it. Could you point me to the documentation?
    ✅ 1
    b
    • 2
    • 4
  • l

    LeoColman

    09/24/2021, 11:56 PM
    Do you guys face this? If you pay attention you'll see that on all margins there's a small white 'padding', although I didn't configure any spacing on the sides. Is it possible to disable this? Or is this just the standard? (Backender Kotliner trying to play with frontend a bit 😅 )
    ✅ 1
    g
    d
    • 3
    • 17
  • g

    Greg Steckman

    09/26/2021, 12:34 AM
    With a controlled TextInput on version 1.0.0-alpha4-build348, I am seeing the following behavior: every time a character is entered, the text cursor moves to the right of the entire text string that is in the control. Has anyone else observed this or am I doing something wrong? I essentially followed the example in the release notes to build 321, trying with both an Input and a TextInput.
    👍🏻 1
    o
    • 2
    • 1
  • l

    LeoColman

    09/26/2021, 5:50 PM
    Hey guys! Due to my earlier post I created this SO question and answer I want to discuss this. As a new frontend developer this issue was a bit strange for me. I've had attempts with Vue and React, and I don't remember having an issue with this default margin. On our landing page the margin is removed, but I don't see this mentioned anywhere else. Should this 0 margin be the default for compose?
    e
    n
    • 3
    • 2
  • b

    Big Chungus

    09/26/2021, 6:40 PM
    Is it possible to render <svg> tag with compose-web? Autocomplete does not give any
    Svg(...)
    composable
    ➕ 2
    a
    u
    • 3
    • 3
  • s

    salomonbrys

    09/27/2021, 6:01 PM
    Is it possible to understand what triggered recomposition ? I have 2 compositions in sequence and I'd like to understand why.
    o
    • 2
    • 4
  • s

    Slackbot

    09/27/2021, 8:37 PM
    This message was deleted.
    b
    • 2
    • 1
  • b

    Big Chungus

    09/27/2021, 11:09 PM
    Is it possible to set a boolean html attribute (not property) with compose? attr("name", true.unsafeCast<String>()) sets it as name="", whereas it should set it as just name with no empty string value.
    r
    s
    +2
    • 5
    • 13
  • u

    uli

    09/28/2021, 8:05 AM
    Any news on web-core builds? https://kotlinlang.slack.com/archives/C01D6HTPATV/p1632781381376800?thread_ts=1632772852.373600&amp;cid=C01D6HTPATV
    h
    • 2
    • 2
  • u

    uli

    09/29/2021, 9:03 AM
    Hi all, I have a compose multi platform project (android, desktop, browser, iOS). In my shared module, if I declare the JS target as
    js(BOTH)
    things work fine and my
    js(IR)
    based frontend modules can consume the shared artefacts just fine. If I declare the JS target as
    js(IR)
    in the shared module I get the following exception:
    > Task :shared:compileKotlinJs
    exception: java.lang.IllegalStateException: Cannot find the Composer class in the classpath
    	at androidx.compose.compiler.plugins.kotlin.lower.AbstractComposeLowering.<init>(AbstractComposeLowering.kt:195)
    o
    • 2
    • 7
  • c

    Carter

    09/29/2021, 1:00 PM
    Is there any prioritization that might be given to this issue that breaks buttons on iOS? I’m deciding between whether should hack a workaround in my app or whether I wait for a Compose release to incorporate a fix.
    o
    • 2
    • 4
Powered by Linen
Title
c

Carter

09/29/2021, 1:00 PM
Is there any prioritization that might be given to this issue that breaks buttons on iOS? I’m deciding between whether should hack a workaround in my app or whether I wait for a Compose release to incorporate a fix.
o

Oleksandr Karpovich [JB]

09/29/2021, 1:37 PM
The fix won't be added in the next week build (if this helps). Sorry for delay.
c

Carter

09/30/2021, 11:55 AM
Even if it is the week after, that would be OK for my timeline. But if it goes into late October or November, then I might have to start implementing a workaround.
Thanks for the reply, I appreciate it.
o

Oleksandr Karpovich [JB]

09/30/2021, 12:09 PM
I see. In my opinion, late October is more realistic (than next 2 weeks) for this one and other fixes.
View count: 3