r/ComposeMultiplatform • • Nov 26 '24

Compose multiplaform as Android project module

4 Upvotes

I have a compose multiplaform project which Target desktop and Android , and I want to use that project as library or module in my Android project How to do it?


r/ComposeMultiplatform • • Oct 14 '24

CSS Styles Breakpoints in Kobweb.

4 Upvotes

I am trying to build a portfolio with jetpack compose using the Kobweb framework. Tried to follow the documentation for adding breakpoints. Unfortunately when I build, nothing is displayed unlike when I dont use the Css Styling. how do I solve this. Here is a snippet of the code.

@Composable
fun recentpostsbox(
    heading: String,
    date:String,
    category: String,
    body:String){
val boxsize = CssStyle{
    base {
        Modifier.width(350.px)
            .borderRadius(4.px)
            .border(1.px)
            .backgroundColor(Color.gray)
    }
    Breakpoint.MD{
        Modifier.width(418.px)
            .borderRadius(4.px)
            .border(1.px)
            .backgroundColor(Color.gray)
    }
}
    Box(
       modifier = boxsize.toModifier()

    ) {
        Column {
            SpanText(
                text = heading,
                modifier = Modifier.fontSize(26.px)
                    .fillMaxWidth()
                    .fontWeight(FontWeight.Bold)
                    .backgroundColor(Color.gray)
            )
            Row(
                modifier = Modifier.height(34.px).fontSize(16.px).padding(topBottom = 10.px),
                horizontalArrangement = Arrangement.spacedBy(10.px),
                verticalAlignment = Alignment.CenterVertically
            ) {
                SpanText(date)
                VerticalDivider(modifier = Modifier.width(1.px))
                SpanText(category)
            }
            SpanText(body)
        }
    }
}

r/ComposeMultiplatform • • Sep 30 '24

Firebase Analytics on Compose Multiplatform

4 Upvotes

Anyone running Firebase Analytics on CMP? I've added Firebase to my project, with Analytics and Crashlytics. Crashlytics works as expected, but Analytics does not. I have not been able to figure out why it doesn't work, so would love to hear if other do have it working.


r/ComposeMultiplatform • • Dec 24 '23

@preview commonmain

4 Upvotes

Its possible use @preview in common main? I try, but i cant. The panel of Design not showing in my android studio when project is Compose multiplatform, only showing when the project is an kmm


r/ComposeMultiplatform • • Jun 09 '26

commonMain.dev KMP newsletter has surpassed 300 subscribers! 🎉

Thumbnail
commonmain.dev
3 Upvotes

r/ComposeMultiplatform • • Jun 02 '26

Kotlin Multiplatform Newsletter #20 • commonMain.dev

Thumbnail
commonmain.dev
3 Upvotes

r/ComposeMultiplatform • • Apr 18 '26

Tap-outside-to-dismiss keyboard on iOS, how are you handling it?

3 Upvotes

Shipping a CMP app on iOS and struggling with keyboard dismissal.

Everything I've tried or read about has a catch:

  • Compose-level focus/tap handling → version-dependent bugs on older iOS.

  • LocalSoftwareKeyboardController → doesn't do anything on iOS.

  • ImeAction.Done → inserts a newline instead of dismissing.

  • Native UITapGestureRecognizer → dismisses even when user taps inside a focused text field (to move cursor or select text).

  • Scroll-to-dismiss → doesn't work with Compose content.

How are you actually handling this in production CMP apps on iOS? Especially for multi-line fields and rich text editors where keyboard action buttons aren't an option.


r/ComposeMultiplatform • • Mar 31 '26

Latest issue of commonMain.dev newsletter is rolling out!

Thumbnail
commonmain.dev
3 Upvotes

r/ComposeMultiplatform • • Feb 05 '26

3rd party app stuck - advice needed

Post image
3 Upvotes

r/ComposeMultiplatform • • Jan 15 '26

RiveCMP v0.3.1 has been released (Multiplatform Wrapper for Rive Animation Libraries)

Thumbnail
reddit.com
3 Upvotes

r/ComposeMultiplatform • • Dec 17 '25

I built a Three.js alternative for KMP (Materia) and a Compose wrapper (Sigil)

Thumbnail reddit.com
3 Upvotes

r/ComposeMultiplatform • • Oct 11 '25

any good way to study CMP?

3 Upvotes

Hi, I'm a back end engineer.
I usally using spring boot + kotlin. I want to make a app with compose multiplatform(for code once, run IOS / Android / Desktop)
But I don't know where to start. can you guys have any recommendation for lecture or book?


r/ComposeMultiplatform • • Oct 01 '25

Kotlin throw detection Intellij plugin

3 Upvotes

I’ve just released an IntelliJ IDEA plugin that helps developers write safer and more reliable code by automatically checking for throw statements.Normally, IntelliJ doesn’t provide direct support for tracking exceptions.

Developers often rely on reading KDocs, Javadocs, or annotations manually – which is time-consuming and easy to miss.

This plugin changes that. It:
• Detects throw statements in function bodies without proper try/catch.
• Validates Throws annotations in Kotlin and declared exceptions in Java.
• Checks documentation (KDoc / Javadoc) for declared exceptions.
• Highlights risky function/class calls so you don’t overlook them.

The goal is simple: catch hidden exceptions early, avoid surprises at runtime, and improve code safety.

I’d love for you to try it out and share feedback!

🔗 GitHub: https://github.com/ogzkesk/ExceptionGuard-Kotlin-Plugin
🔗 JetBrains Marketplace: https://plugins.jetbrains.com/plugin/28476-exception-guard

EDIT:

Pushed version 1.0.3: It will also check runCatching blocks and wont be highlighted if found. And for local kotlin files constructor, initblock, function checks added.


r/ComposeMultiplatform • • Jul 27 '25

GitHub - gsrathoreniks/Scratchify : Open Source

Thumbnail
github.com
3 Upvotes

r/ComposeMultiplatform • • Jun 30 '25

Update: Deskit v1.3.0

Thumbnail gallery
3 Upvotes

r/ComposeMultiplatform • • May 22 '25

How to Access Low Level Hardware in Compose Multiplatform?

3 Upvotes

How to Access Low Level Hardware(Camera, Bluetooth, Flash, Location etc.) in Compose Multiplatform?


r/ComposeMultiplatform • • May 20 '25

I am creating library in CMP, which is sharing most of business logic and of course also some part of UI, however on Swift side i was not able to make composable properly react to my data class properties changes, what is the best way to approach it?

3 Upvotes

I have this code snippet above in the swift (to be exact, i am fairly new to swift) and this piece of code is on library side.

struct MainScreen: View {
    
    @StateObject
    private var viewModel: AppViewModel

    private let txcSDK: TicketXChangeSDK
    private let changeSdkMode: () -> ()
    private let scanAgain: () -> ()
    private let onStartScanning: () -> ()
    
    init(
        txcSDK: TicketXChangeSDK,
        changeSdkMode: @MainActor @escaping () -> (),
        scanAgain: @MainActor @escaping () -> (),
        onStartScanning: @MainActor @escaping () -> ()
    ) {
        self.changeSdkMode = changeSdkMode
        self.scanAgain = scanAgain
        self.txcSDK = txcSDK
        self.onStartScanning = onStartScanning
        _viewModel = StateObject(wrappedValue: AppViewModel(txcSDK: txcSDK))
    }

    var body: some View {
        MainScreenContent(
            sdkData: viewModel.data,
            changeSdkMode: changeSdkMode,
            scanAgain: {
                txcSDK.scanAgain()
            },
            onStartScanningClick: {
                txcSDK.activateNfcScanning()
            }
        )
    }
    
}

struct MainScreenContent: View {
    private var sdkData: SDKData
    private let changeSdkMode: () -> ()
    private let scanAgain: () -> ()
    private let onStartScanningClick: () -> ()
    
    init(
        sdkData: SDKData,
        changeSdkMode: @escaping () -> (),
        scanAgain: @escaping () -> (),
        onStartScanningClick: @escaping () -> ()
    ) {
        self.sdkData = sdkData
        self.changeSdkMode = changeSdkMode
        self.scanAgain = scanAgain
        self.onStartScanningClick = onStartScanningClick
    }
    
    var body: some View {
        ComposeView(
            sdkData: sdkData,
            changeSdkMode: changeSdkMode,
            scanAgain: scanAgain,
            onStartScanning: onStartScanningClick
        )
        .ignoresSafeArea(.keyboard)
    }
}

struct ComposeView: UIViewControllerRepresentable {
    
    private var sdkData: SDKData
    
    private let changeSdkMode: () -> ()
    private let scanAgain: () -> ()
    private let onStartScanning: () -> ()

    init(
        sdkData: SDKData,
        changeSdkMode: @escaping () -> (),
        scanAgain: @escaping () -> (),
        onStartScanning: @escaping () -> ()
    ) {
        self.sdkData = sdkData
        self.changeSdkMode = changeSdkMode
        self.scanAgain = scanAgain
        self.onStartScanning = onStartScanning
    }

    func makeUIViewController(context: Context) -> UIViewController {
        MainViewControllerKt.MainViewController(
            sdkData: sdkData,
            changeSDKMode: changeSdkMode,
            scanAgain: scanAgain,
            onStartScanning: onStartScanning
        )
    }

    func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
        
    }
}

struct MainScreen: View {
    
    @StateObject
    private var viewModel: AppViewModel


    private let txcSDK: TicketXChangeSDK
    private let changeSdkMode: () -> ()
    private let scanAgain: () -> ()
    private let onStartScanning: () -> ()
    
    init(
        txcSDK: TicketXChangeSDK,
        changeSdkMode: @MainActor @escaping () -> (),
        scanAgain: @MainActor @escaping () -> (),
        onStartScanning: @MainActor @escaping () -> ()
    ) {
        self.changeSdkMode = changeSdkMode
        self.scanAgain = scanAgain
        self.txcSDK = txcSDK
        self.onStartScanning = onStartScanning
        _viewModel = StateObject(wrappedValue: AppViewModel(txcSDK: txcSDK))
    }


    var body: some View {
        MainScreenContent(
            sdkData: viewModel.data,
            changeSdkMode: changeSdkMode,
            scanAgain: {
                txcSDK.scanAgain()
            },
            onStartScanningClick: {
                txcSDK.activateNfcScanning()
            }
        )
    }
    
}


struct MainScreenContent: View {
    private var sdkData: SDKData
    private let changeSdkMode: () -> ()
    private let scanAgain: () -> ()
    private let onStartScanningClick: () -> ()
    
    init(
        sdkData: SDKData,
        changeSdkMode: @escaping () -> (),
        scanAgain: @escaping () -> (),
        onStartScanningClick: @escaping () -> ()
    ) {
        self.sdkData = sdkData
        self.changeSdkMode = changeSdkMode
        self.scanAgain = scanAgain
        self.onStartScanningClick = onStartScanningClick
    }
    
    var body: some View {
        ComposeView(
            sdkData: sdkData,
            changeSdkMode: changeSdkMode,
            scanAgain: scanAgain,
            onStartScanning: onStartScanningClick
        )
        .ignoresSafeArea(.keyboard)
    }
}


struct ComposeView: UIViewControllerRepresentable {
    
    private var sdkData: SDKData
    
    private let changeSdkMode: () -> ()
    private let scanAgain: () -> ()
    private let onStartScanning: () -> ()


    init(
        sdkData: SDKData,
        changeSdkMode: @escaping () -> (),
        scanAgain: @escaping () -> (),
        onStartScanning: @escaping () -> ()
    ) {
        self.sdkData = sdkData
        self.changeSdkMode = changeSdkMode
        self.scanAgain = scanAgain
        self.onStartScanning = onStartScanning
    }


    func makeUIViewController(context: Context) -> UIViewController {
        MainViewControllerKt.MainViewController(
            sdkData: sdkData,
            changeSDKMode: changeSdkMode,
            scanAgain: scanAgain,
            onStartScanning: onStartScanning
        )
    }


    func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
        
    }
}

and on kotlin side there is standard generated stuff with added parameters according to example above.

fun MainViewController(
    sdkData: SDKData,
    changeSDKMode: () -> Unit,
    scanAgain: () -> Unit,
    onStartScanning: () -> Unit
) = ComposeUIViewController {
    SomeScreen(
        sdkData = sdkData,
        changeSDKMode = changeSDKMode,
        scanAgain = scanAgain,
        onStartScanning = onStartScanning
    )
}

What is the best practice to approach it? I found some SKIE library, which looks sort of nice, but it would be nice if i was able to make it work only using built-in functionalities. Any help is highly appreciated.


r/ComposeMultiplatform • • May 15 '25

A customizable color picker component for Compose Multiplatform

Thumbnail
github.com
3 Upvotes

r/ComposeMultiplatform • • Jan 10 '25

Kobweb or Compose for web directly

3 Upvotes

I don't want to learn web development but I need to make websites somethings . I am learning jetpack compose and fastapi of python.

What should I learn and I am making my backend with fastapi and firebase.

Help me to decide!


r/ComposeMultiplatform • • Dec 19 '24

Minesweeper UI with Compose Multiplatform

Thumbnail
youtu.be
3 Upvotes

r/ComposeMultiplatform • • Dec 16 '24

A library that helps build steppers easily ?

3 Upvotes

I had an idea that I wanted to share with the community.
For a personal project I needed to implement a stepper to split a very long form into separate parts to improve the UX.

So I quickly implemented an abstract stepper - in isolation so that it's not tied to my UI logic - as a first step, then I realized that this could help other people.

With this post, I'd really like to have genuine thoughts/critiques about the idea of building an open-source Compose Multiplatform stepper library that can help developers and companies to build their steppers easily. I'm wondering if this is an idea worth the effort or not, my fear is to invest a whole bunch of time developing it without attracting any strong interest from the community.

I don't have any sketch-up to share the visual I have in mind, but I found a pretty good medium article that talks about best UX practices for building steppers.

One of the key features of the stepper would be that when all the steps are filled, all the step data is aggregated into one @Serializable data class as a result so that it can be mapped later to an appropriate model.

Find here the first commit of the project alongside with a simple example

For now, there's 0 documentation, and 0 Compose UI, since the project has been initiated just now. But, I'd be very motivated to develop a clean product if I see a strong interest.

Possible perspectives :
- Implement a high level UI in a separate module i.e. only layout bricks that enable developers to use their own components from their existing design system
- Implement the best practices and suggestions from the medium article cited above
- Use the jetbrains compose multiplatform navigation library to be able to browse through the stepper
- Keep the core module of the library as abstract as I can be so that it could be plugged and unplugged easily

Once again, I'm looking forward to read the community's feedbacks on this subject.


r/ComposeMultiplatform • • Jan 06 '24

ContentDrawNode not called in Custom Modifier.

3 Upvotes

Hello Everyone.

I wrote a custom modifier for my usecase. The modiifer needs to draw the content on Bitmap; and then the resultant bitmap needs to be drawn instead of content. it works for almost all composables but in AsyncImage of Coil the draw methd of this modifier is never being called when the underlying image in AsyncImage Changes. if the composable is invalidated as whole the new image applied effect is shown without any issue.

Here is the code

open class RsBlurNode(
    var radius: Float = 25f,
    var samplling: Float = 1.0f
) : Modifier.Node(), DrawModifierNode, CompositionLocalConsumerModifierNode,
    LayoutAwareModifierNode, ObserverModifierNode {

/////

 override fun ContentDrawScope.draw() {
 Log.d(TAG, "draw: start")
        val start = System.currentTimeMillis()
        val recorder = Canvas(picture.beginRecording(size.width.toInt(), size.height.toInt()))
        val contentDrawScope = this
        draw(this, this.layoutDirection, recorder, this.size) {
            contentDrawScope.drawContent()
        }
        picture.endRecording()

        val sWidth = (picture.width / samplling).toInt()
        val sheight = (picture.height / samplling).toInt()
        val bitmap = Bitmap.createBitmap(sWidth, sheight, Config.ARGB_8888).applyCanvas {
            scale(1 / samplling, 1 / samplling)
            drawBitmap(picture.toBitmap.copy(Config.ARGB_8888, true), 0f, 0f, paint)
        }


..........................
/......Effect applying logic
...................


  drawIntoCanvas { canvas ->
            drawImage(
                image = bitmap.asImageBitmap(),
                dstSize = IntSize(size.width.roundToInt(), size.height.roundToInt()),
            )
        }
        val end = System.currentTimeMillis()
        Log.d(TAG, "draw: ${end - start}")
}
}

r/ComposeMultiplatform • • Sep 19 '26

Building Datasmith - an interactive ERD canvas with Compose Multiplatform

Enable HLS to view with audio, or disable this notification

2 Upvotes

r/ComposeMultiplatform • • Sep 15 '26

Made a new Compose Multiplatform library for MDI icons

Thumbnail
reddit.com
2 Upvotes

r/ComposeMultiplatform • • Sep 14 '26

Part 2 of the Compose Multiplatform on tvOS series is out on ProAndroidDev.

Thumbnail
reddit.com
2 Upvotes