Compose for Desktop is modern toolkit for building native declarative UI made by JetBrains. It's based on Google's Jetpack Compose
Questions tagged [compose-desktop]
147 questions
2
votes
1 answer
How to set serializer to an internal class extending a public interface?
I'm trying to create a serializer using kotlinx.serialization for Compose Desktop classes, I have this :
@Serializer(forClass = MutableState::class)
class MutableStateSerializer(private val dataSerializer: KSerializer) :…

Ayfri
- 570
- 1
- 4
- 24
2
votes
2 answers
Jetpack Compose mutableStateList vs mutableList Performance
How do mutableState, mutableStateList, mutableStateMap perform in comparison to a normal variable, mutableList, mutableMap? If there are observers listening they will be slower of course (because recomposition is triggered) but is there a difference…

nhcodes
- 1,206
- 8
- 20
2
votes
1 answer
How to vertically align the text and leading/trailing icons in a TextField
Is there a way to set the trailing/leading icons and the text on the same level? On default it is not as shown in the image below. I tried changing the fontStyle parameter in TextField but no success. The text is shown higher than the icons
import…

Zen1000
- 147
- 9
2
votes
1 answer
Jetpack Compose Desktop: Scrollable Column/LazyColumn
I'm creating a program in Jetpack Compose Desktop version 1.0.0-beta5 and I can't figure out how to make Column/LazyColumn scrollable. At the same time, it seems to me that a lot of the classes listed in the documentation for Android are missing and…

Honza Rössler
- 332
- 3
- 11
2
votes
1 answer
How to move DropdownMenu to preferable location in Jepack Compose
Is it possible to center DropdownMenu in my example? or show it wherever I click or tap?
I tried alignment and arrangements and none of them work. I prefer showing the DropdownMenu wherever I tab but I couldn't find a way to do it.
fun main() =…

Mehranjp73
- 341
- 6
- 20
2
votes
1 answer
Divider composable becomes invisible when placed inside composable with horizontalScroll modifier set. Is this a bug?
Background
I am making a desktop compose application.
I had a LazyColumn with Divider separating items. LazyColumn's width may not fit in window so I made the LazyColumn horizontally scrollable by enclosing it inside a Box with horizontalScroll()…

Om Kumar
- 1,404
- 13
- 19
2
votes
1 answer
Actual/expect funs in shared throw NoSuchMethodError in Kotlin Multiplatform
I am developing a dummy weather app with the help of Kotlin Multiplatform. I am using Decompose and MVIKotlin to try and share all the business logic except the native uis, SwiftUI for IOS and Compose for Desktop and Android.
I am trying to have a…

Nikola-Milovic
- 1,393
- 1
- 12
- 35
2
votes
1 answer
Jetpack Compose Desktop switch to new window
Hey I'm pretty new to Kotlin and am trying my hand at a GUI as my first small project.
For this I am using Jetpack Compose Desktop. I have already written a first small login window ( not the one in the GIF), and would like to open a new window with…

Simon
- 77
- 1
- 7
2
votes
1 answer
Clickable areas of image (Mouseover event) - Jetpack Compose Desktop
Any idea of how to approach clickable areas on the image? It would be great if in desktop build (yeah the desktop mode is available now :) https://www.jetbrains.com/lp/compose/) they have smth like onMouseover, so they could be highlighted when the…

kocyk
- 41
- 1
- 5
1
vote
1 answer
How and when exactly CompositionLocal sets values implicitly?
I'm trying to understand how CompositionLocal actually sets values implicitly and what requiremnts need to be met so that it works, but Android's documentation about Locally scoped data with CompositionLocal isn't helping.
There is an example where…

t3chb0t
- 16,340
- 13
- 78
- 118
1
vote
1 answer
How do I make ViewModels talk to each other in a Compose Desktop app?
I'm building a Jetpack Compose Deskop app that currently as a draft looks like this:
The 1 and 2 are two ViewModels:
// 1
class FilterViewModel {
val query = mutableStateOf(null)
val timeframe = mutableStateOf("Any")
}
// 2
class…

t3chb0t
- 16,340
- 13
- 78
- 118
1
vote
1 answer
Is there a way to connect Firebase Realtime Database to Compose Multiplatform project?
I started working on a desktop application in Intelij Idea with Compose Multiplatform plugin. I want to connect Firebase Realtime Database to this project. But I couldn't find anything on this topic, is it possible? if so how to do it?
I tried to…

RUD0MIR
- 11
- 1
1
vote
1 answer
Compose Desktop DropdownMenu with vertical scroll bar
I'm taking a DropdownMenu from Kotlin Compose for Desktop and I want to include a vertical scroll bar. The source code for the DropdownMenu is here. They have a sample which works fine but I can't get it to display the vertical scroll bar. It…

Jesser
- 76
- 7
1
vote
1 answer
Using Jetpack Compose (Desktop), how can I render to an image without a window?
My use case that I'm attempting to create is a way to render a Compose application directly to a file, ideally without requiring an actual GUI window, e.g. for rendering the app on a server that does not have any UI.
Using Jetpack Compose (Desktop)…

Boni2k
- 3,255
- 3
- 23
- 27
1
vote
1 answer
Compose Desktop composable names starts with lowercase
as you all may know a Composable function names in Jetpack Compose should start with Uppercase.
but in Compose Desktop editor shows warning when I use Uppercase letter for my Composable first letter!
Function name 'App' should start with a lowercase…

MohammadBaqer
- 766
- 6
- 32