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

Joost Klitsie

12/04/2021, 2:00 PM
Hello dear people! I wanted to have some fun with Compose for web 🙂 I was wondering, if I wanted to have an animation, for example an opacity animation from 0 to 1, should I use CSS or can I use compose animation methods? (like on jetpack compose)
a

Akif Abasov [JB]

12/04/2021, 5:35 PM
only css is performant enough in DOM version of compose
It’s not because of compose itself, but because of how DOM works
j

Joost Klitsie

12/04/2021, 5:37 PM
I thought so, i made it work using simple transitions :)
a

Akif Abasov [JB]

12/04/2021, 7:58 PM
there is also web animation api with keyframes
j

Joost Klitsie

12/04/2021, 8:00 PM
I was struggling a bit with that to be honest, if I have this:
Copy code
Div(attrs = {
    style = {
        animation with keyframes?
    }
}) {
    content...
}
How would I set up this animation with keyframes? 🙂 Do you per chance know?
a

Akif Abasov [JB]

12/05/2021, 6:08 PM
You need to define it in StyleSheet
5 Views