Native interop with Jetpack Compose and SwiftUI handlers #29199
Replies: 2 comments 3 replies
-
I am also interested in this question. As you have laid out, it certainly does appear that Jetpack Compose and SwiftUI are very much the direction of travel. Achieving some form of interop with these would seem to be essential to securing a long-term future for MAUI, at least so long as the rendering model continues to be to target native controls on each platform. Whilst the UIKit and Views approaches are not likely to disappear in the short term, it's clear the latest platform features are going to be focussed around the new frameworks.
I had the same question in mind, and I have tried to find the latest public statements on this topic. My understanding is that in the case of SwiftUI, there is work to be done by the .NET runtime team as a pre-requisite, tracked here: I'm less clear on what is required for Compose support within MAUI, and I could not find a work item anywhere regarding this, but did find some related discussion on the below pull reuqest, where it sounds like the dotnet android tooling would have to perform some functions currently performed by a kotlin compiler plugin. Perhaps @jonathanpeppers might be willing to let us know if anything along these lines is or could be planned?
Whilst it's perhaps not a DSL at the level of the runtime, we've loved using the .NET MAUI Markup Community Toolkit in favour of XAML for a few years now, with great results. It does allow a declarative paradigm, similar to SwiftUI and Compose, to be used today. |
Beta Was this translation helpful? Give feedback.
-
Regarding the original comment:
I'm not sure that is true, this would mean Android deprecates hundreds, (thousands?) of APIs that have been available since Android API 1. I just don't think they can ever break the entire ecosystem like that. |
Beta Was this translation helpful? Give feedback.
-
💡 Idea Summary
With the ongoing deprecation of Android’s XML-based Views and Apple’s increasing shift toward SwiftUI, it’s worth considering a future direction where .NET MAUI’s handlers system could directly integrate with Jetpack Compose and SwiftUI as the native render targets, instead of relying on legacy UI frameworks (ViewGroup/UIViews/etc).
🤔 Why This Matters
Jetpack Compose is now the official recommended way to build Android UIs.
SwiftUI is rapidly replacing UIKit and storyboards on Apple platforms.
MAUI currently renders to legacy view systems, which may be deprecated or unsupported in the coming years.
Modern UI trends favor declarative and composable UI DSLs, which are currently missing in MAUI unless we manually implement a C#-only abstraction.
🧱 Proposed Approach
Extend the MAUI handler architecture to optionally target:
Jetpack Compose components (e.g., Text, Column, Row, etc.)
SwiftUI views (Text, VStack, Button, etc.)
Create bridges or rendering backends that allow MAUI to map controls like Label, Button, VerticalStackLayout to their modern native equivalents:
Example:
new Label { Text = "Hello" } // maps to -> Text("Hello") in Compose or SwiftUI based on platform
No reliance on XML or Storyboards, enabling full C#-driven app logic with modern native performance and look.
👉 QUESTION
What is the long-term plan for MAUI once native Android Views and Storyboards are no longer supported?
Will handlers eventually be mapped to Jetpack Compose/SwiftUI?
Will Microsoft introduce a C#-native declarative UI DSL similar to Compose/SwiftUI?
Beta Was this translation helpful? Give feedback.
All reactions