Join Slack
Powered by
How do I get previews for shared composables in `c...
# compose
r
Rafs
06/22/2023, 2:13 PM
How do I get previews for shared composables in
commonMain
a
Arkadii Ivanov
06/22/2023, 2:23 PM
Assuming you support Compose for Desktop (JVM): 1. Put this annotation (notice the package name):
https://github.com/arkivanov/Decompose/blob/master/sample/shared/compose/src/commonMain/kotlin/androidx/compose/desktop/ui/tooling/preview/Preview.kt
2. Write previews as usual (notice the suppress annotation at the top of the file):
https://github.com/arkivanov/Decompose/blob/41f630f319fbcbea953065478231d8c9d0f1e1c1/sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/cards/card/CardContent.kt#L72
Don't forget to add required dependencies and install the Compose Multiplatform IDEA plugin:
https://plugins.jetbrains.com/plugin/16541-compose-multiplatform-ide-support
r
Rafs
06/22/2023, 2:25 PM
I don't have desktop support yet, I was hoping I could get previews without that
30
Views
Open in Slack
Previous
Next